/* ============================================
   Shop Page — Modern Redesign
   ============================================ */

/* -----------------------------------------------
   HERO BANNER
   ----------------------------------------------- */
.shop-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #fff;
    padding: 0;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}
.shop-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 85%, rgba(0,123,255,.12) 0%, transparent 50%),
        radial-gradient(circle at 85% 15%, rgba(0,200,150,.08) 0%, transparent 50%);
    pointer-events: none;
}
.shop-hero-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 48px 24px 42px;
    position: relative;
    z-index: 1;
}
.shop-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.shop-breadcrumb a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .2s;
}
.shop-breadcrumb a:hover { color: #fff; }
.shop-breadcrumb i { font-size: 9px; color: rgba(255,255,255,.3); }
.shop-breadcrumb span { color: rgba(255,255,255,.85); }

.shop-hero-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
}
.shop-hero-subtitle {
    font-size: 14px;
    opacity: .6;
}

/* -----------------------------------------------
   FILTER TOOLBAR
   ----------------------------------------------- */
.shop-toolbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 72px; /* below header */
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.shop-toolbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 24px;
}
.toolbar-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.toolbar-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}
.toolbar-search > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}
.toolbar-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #f9fafb;
    transition: all .2s;
    outline: none;
}
.toolbar-search input:focus {
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,123,255,.08);
}

.toolbar-filters {
    display: flex;
    gap: 10px;
}
.toolbar-select-wrap {
    position: relative;
}
.toolbar-select-wrap > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}
.toolbar-select {
    padding: 10px 36px 10px 36px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
    background: #f9fafb;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 32px;
    transition: all .2s;
    outline: none;
}
.toolbar-select:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0,123,255,.08);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s;
    border: none;
}
.toolbar-btn-search {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,.2);
}
.toolbar-btn-search:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,.25);
}
.toolbar-btn-clear {
    background: #fef2f2;
    color: #dc3545;
    border: 1px solid #fecaca;
}
.toolbar-btn-clear:hover {
    background: #fee2e2;
}

/* Mobile filter toggle */
.mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    color: #374151;
    position: relative;
    transition: all .2s;
}
.mobile-filter-toggle.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
.filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -----------------------------------------------
   ACTIVE FILTERS STRIP
   ----------------------------------------------- */
.active-filters {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}
.active-filters-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.active-filters-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #92400e;
}
.active-filters-label i { margin-right: 4px; }
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 20px;
    font-size: 12.5px;
    color: #92400e;
    text-decoration: none;
    transition: all .2s;
}
.filter-tag:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}
.filter-tag i { font-size: 10px; }
.clear-all-filters {
    margin-left: auto;
    font-size: 12.5px;
    color: #dc3545;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s;
}
.clear-all-filters:hover { color: #b91c1c; }

/* -----------------------------------------------
   PRODUCTS SECTION
   ----------------------------------------------- */
.shop-products {
    background: #f8f9fb;
    min-height: 60vh;
}
.shop-products-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 36px 24px 60px;
}

/* -----------------------------------------------
   PRODUCT GRID
   ----------------------------------------------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 24px;
}

/* -----------------------------------------------
   PRODUCT CARD
   ----------------------------------------------- */
.product-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.04);
    display: flex;
    flex-direction: column;
    transition: all .35s cubic-bezier(.22,1,.36,1);
    animation: shopCardIn .4s ease both;
}
@keyframes shopCardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,.08);
    border-color: rgba(0,123,255,.1);
}

/* Image */
.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f3f4f6;
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all .5s cubic-bezier(.22,1,.36,1);
}
.product-image img.fallback-image {
    object-fit: contain;
    padding: 20px;
    background: #fff;
}
.primary-image { display: block; }
.hover-image {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.product-card:hover .primary-image { opacity: 0; }
.product-card:hover .hover-image { opacity: 1; }
.product-card:hover .product-image img { transform: scale(1.05); }

/* Badges */
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    z-index: 3;
}
.badge-sale {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 2px 8px rgba(220,53,69,.25);
}
.badge-soldout {
    background: #6b7280;
    color: #fff;
}

/* Quick View button */
.quick-view-btn {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #1a1a2e;
    cursor: pointer;
    transition: all .3s cubic-bezier(.22,1,.36,1);
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    white-space: nowrap;
}
.quick-view-btn i { margin-right: 5px; }
.product-card:hover .quick-view-btn {
    bottom: 14px;
}
.quick-view-btn:hover {
    background: #007bff;
    color: #fff;
}

/* Info */
.product-info {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-name-link { text-decoration: none; }
.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px;
    line-height: 1.4;
    transition: color .2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-name-link:hover .product-name { color: #007bff; }

.product-category {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    width: fit-content;
    transition: all .2s;
}
.product-card:hover .product-category {
    background: #e0f2fe;
    color: #0369a1;
}

/* Price */
.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.price-current {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
}
.price-original {
    font-size: 14px;
    color: #9ca3af;
    text-decoration: line-through;
}
.price-discount {
    font-size: 11.5px;
    font-weight: 700;
    color: #dc3545;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Bottom section */
.product-bottom {
    margin-top: auto;
}
.product-actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* Quantity wrap */
.qty-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.qty-btn {
    width: 32px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    color: #374151;
    font-size: 11px;
    transition: all .2s;
}
.qty-btn:hover {
    background: #e5e7eb;
    color: #007bff;
}
.qty-input {
    width: 36px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    background: #fff;
    outline: none;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add to cart */
.add-to-cart-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 16px;
    height: 36px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 2px 8px rgba(0,123,255,.2);
    white-space: nowrap;
}
.add-to-cart-btn i { font-size: 12px; }
.add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,123,255,.3);
    background: linear-gradient(135deg, #0069d9, #004db3);
}
.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Stock indicator */
.stock-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    margin-top: 12px;
}
.stock-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.in-stock-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.out-stock-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}

/* -----------------------------------------------
   NO PRODUCTS
   ----------------------------------------------- */
.no-products {
    text-align: center;
    padding: 80px 24px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f3f4f6;
}
.no-products-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: #9ca3af;
}
.no-products h3 {
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.no-products p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}
.no-products-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: #007bff;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(0,123,255,.2);
}
.no-products-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* -----------------------------------------------
   PAGINATION
   ----------------------------------------------- */
.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid #e5e7eb;
    gap: 16px;
    flex-wrap: wrap;
}
.pagination-info {
    font-size: 13px;
    color: #6b7280;
}
.pagination-info span { opacity: .7; }
.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    text-decoration: none;
    transition: all .2s;
}
.page-btn:hover {
    border-color: #007bff;
    color: #007bff;
    background: #f0f7ff;
    transform: translateY(-1px);
}
.page-active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0,123,255,.2);
    cursor: default;
}
.page-active:hover {
    background: #007bff;
    color: #fff;
    transform: none;
}
.page-prev, .page-next {
    font-size: 13px;
}
.page-dots {
    color: #9ca3af;
    font-size: 14px;
    padding: 0 4px;
}

/* -----------------------------------------------
   TOAST NOTIFICATIONS
   ----------------------------------------------- */
.shop-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.12);
    z-index: 10000;
    max-width: 380px;
    opacity: 0;
    transform: translateY(20px) scale(.95);
    transition: all .3s cubic-bezier(.22,1,.36,1);
    border-left: 4px solid #6b7280;
}
.shop-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.shop-toast-success { border-left-color: #22c55e; }
.shop-toast-error   { border-left-color: #ef4444; }

.shop-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.shop-toast-success .shop-toast-icon { color: #22c55e; }
.shop-toast-error   .shop-toast-icon { color: #ef4444; }

.shop-toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.shop-toast-body strong {
    font-size: 14px;
    color: #1a1a2e;
}
.shop-toast-body span {
    font-size: 12.5px;
    color: #6b7280;
}
.shop-toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    transition: color .2s;
}
.shop-toast-close:hover { color: #374151; }

/* -----------------------------------------------
   LOADING OVERLAY
   ----------------------------------------------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: shopSpin .7s linear infinite;
}
@keyframes shopSpin {
    to { transform: rotate(360deg); }
}

/* -----------------------------------------------
   RESPONSIVE
   ----------------------------------------------- */

/* ≤ 992px — Tablet */
@media (max-width: 992px) {
    .toolbar-form {
        display: none;
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-form.toolbar-open {
        display: flex;
        padding-top: 12px;
    }
    .toolbar-search { max-width: 100%; }
    .toolbar-filters { flex-direction: column; }
    .toolbar-select-wrap { width: 100%; }
    .toolbar-select { width: 100%; }
    .toolbar-actions { margin-left: 0; }
    .toolbar-btn { flex: 1; justify-content: center; }

    .mobile-filter-toggle {
        display: flex;
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
    }
}

/* ≤ 768px — Mobile */
@media (max-width: 768px) {
    .shop-hero-inner {
        padding: 36px 20px 32px;
    }
    .shop-toolbar-inner {
        padding: 12px 20px;
    }
    .shop-products-inner {
        padding: 24px 16px 48px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .product-info {
        padding: 14px;
    }
    .product-name {
        font-size: 13.5px;
    }
    .price-current { font-size: 16px; }
    .price-original { font-size: 12px; }

    .product-actions {
        flex-direction: column;
        gap: 8px;
    }
    .qty-wrap { width: 100%; justify-content: center; }
    .qty-input { flex: 1; }
    .add-to-cart-btn { width: 100%; height: 38px; }

    .quick-view-btn { display: none; }

    .shop-pagination {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .active-filters-inner {
        padding: 10px 16px;
    }

    .shop-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ≤ 480px — Small Mobile */
@media (max-width: 480px) {
    .shop-hero-inner {
        padding: 28px 16px 24px;
    }
    .shop-hero-title { font-size: 22px; }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-info { padding: 10px 12px 14px; }
    .product-name { font-size: 12.5px; margin-bottom: 6px; }
    .product-category { font-size: 10px; padding: 2px 8px; margin-bottom: 8px; }
    .price-current { font-size: 15px; }
    .price-original { font-size: 11px; }
    .price-discount { font-size: 10px; }
    .product-badge { font-size: 10px; padding: 3px 8px; top: 8px; left: 8px; }

    .stock-indicator { font-size: 11px; }

    .qty-wrap {
        width: 100%;
    }
    .qty-btn { width: 30px; height: 32px; }
    .qty-input { height: 32px; font-size: 12px; }
    .add-to-cart-btn { font-size: 12px; height: 34px; }
    .add-to-cart-btn span { display: none; }
    .add-to-cart-btn i { font-size: 14px; }

    .page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 8px;
    }
}

/* ≤ 360px — Very Small */
@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .product-image { aspect-ratio: 4/3; }
}
