/**
 * ArcticBlue Component Styles
 * Bootstrap-based component styling for custom components
 * 
 * @version 1.0.0
 * @author ABAI
 */

/* ============================================
   LOADING SPINNER
   ============================================ */
.ab-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.ab-loader .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.product-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.product-card .product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-card .product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.product-card .product-actions .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.product-card .product-info {
    padding: 1rem;
}

.product-card .product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card .product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card .product-name a:hover {
    color: var(--bs-primary);
}

.product-card .product-rating {
    margin-bottom: 0.5rem;
}

.product-card .product-price-wrapper {
    margin-bottom: 0.75rem;
}

/* Product Card - List Layout */
.product-card-list {
    display: flex;
    flex-direction: row;
}

.product-card-list .product-image {
    width: 250px;
    flex-shrink: 0;
}

.product-card-list .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-list .product-description {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================
   QUANTITY INPUT
   ============================================ */
.quantity-wrapper {
    max-width: 150px;
}

.quantity-wrapper .qty-input {
    text-align: center;
    border-left: 0;
    border-right: 0;
}

.quantity-wrapper .qty-btn-minus,
.quantity-wrapper .qty-btn-plus {
    border: 1px solid #ced4da;
}

.quantity-wrapper .qty-btn-minus:disabled,
.quantity-wrapper .qty-btn-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FILTERS SIDEBAR
   ============================================ */
.filters-sidebar {
    position: sticky;
    top: 20px;
}

.filter-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.filter-group:last-child {
    border-bottom: 0;
}

.filter-group-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.filter-group-title i {
    transition: transform 0.3s ease;
}

.filter-group-title.collapsed i {
    transform: rotate(180deg);
}

.filter-options {
    max-height: 250px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.filter-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.filter-option-count {
    margin-left: auto;
    color: #6c757d;
    font-size: 0.875rem;
}

/* ============================================
   PRICE RANGE SLIDER
   ============================================ */
.price-range-slider {
    padding: 1rem 0;
}

.price-range-values {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.price-range-input {
    width: 45%;
}

/* ============================================
   PRODUCT GALLERY
   ============================================ */
.product-gallery {
    position: relative;
}

.product-gallery-main {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8f9fa;
}

.product-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
}

.product-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.product-gallery-thumbnail {
    position: relative;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.product-gallery-thumbnail:hover,
.product-gallery-thumbnail.active {
    border-color: var(--bs-primary);
}

.product-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   CART DRAWER
   ============================================ */
.cart-drawer-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.cart-drawer-item:last-child {
    border-bottom: 0;
}

.cart-drawer-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f8f9fa;
}

.cart-drawer-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-drawer-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-drawer-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-drawer-item-price {
    font-size: 0.875rem;
    color: #6c757d;
}

.cart-drawer-item-remove {
    padding: 0;
    width: 24px;
    height: 24px;
    border: 0;
    background: transparent;
    color: #dc3545;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cart-drawer-item-remove:hover {
    color: #bb2d3b;
}

.cart-drawer-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* ============================================
   CHECKOUT PROGRESS
   ============================================ */
.checkout-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.checkout-progress li {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
}

.checkout-progress li::before {
    content: counter(step);
    counter-increment: step;
    width: 40px;
    height: 40px;
    line-height: 40px;
    display: block;
    margin: 0 auto 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    background: #fff;
    color: #6c757d;
    font-weight: 600;
}

.checkout-progress li.active {
    color: var(--bs-primary);
}

.checkout-progress li.active::before {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.checkout-progress li.completed::before {
    content: '✓';
    border-color: #198754;
    background: #198754;
    color: #fff;
}

.checkout-progress li::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: #e9ecef;
    z-index: -1;
}

.checkout-progress li:last-child::after {
    display: none;
}

.checkout-progress li.completed::after {
    background: #198754;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    z-index: 9999;
}

.toast {
    min-width: 300px;
}

/* ============================================
   LAZY LOADING
   ============================================ */
img.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy-load.lazy-loaded {
    opacity: 1;
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu-accordion .accordion-button {
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.mobile-menu-accordion .accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: var(--bs-primary);
}

.mobile-menu-accordion .accordion-body {
    padding: 0;
}

.mobile-menu-accordion .list-group-item {
    border: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1.5rem;
}

/* ============================================
   SEARCH AUTOCOMPLETE
   ============================================ */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: 0;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
}

.search-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-autocomplete-item:hover {
    background: #f8f9fa;
}

.search-autocomplete-item:last-child {
    border-bottom: 0;
}

.search-autocomplete-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 0.25rem;
    overflow: hidden;
}

.search-autocomplete-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-autocomplete-info {
    flex: 1;
}

.search-autocomplete-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-autocomplete-price {
    font-size: 0.875rem;
    color: var(--bs-primary);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
    .product-card-list {
        flex-direction: column;
    }
    
    .product-card-list .product-image {
        width: 100%;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .checkout-progress {
        font-size: 0.75rem;
    }
    
    .checkout-progress li::before {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 0.75rem;
    }
    
    .checkout-progress li::after {
        top: 15px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.no-scroll {
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.text-decoration-line-through {
    text-decoration: line-through;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}
