/* ============================================
   Shop Page Styles
   ============================================ */

.shop-page {
    padding: 40px 0 80px;
    background-color: var(--white);
}

.shop-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ============================================
   Sidebar Filters
   ============================================ */

.shop-sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--white);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.currency-indicator-sidebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-purple) 0%, #6b4470 100%);
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(88, 45, 78, 0.2);
}

.currency-indicator-sidebar .flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.filter-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--light-gray);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.filter-checkbox:hover {
    color: var(--primary-purple);
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary-purple);
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: var(--primary-purple);
    border-color: var(--primary-purple);
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-label {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.filter-checkbox:hover .filter-label {
    color: var(--primary-purple);
}

.filter-count {
    color: var(--text-light);
    font-weight: 400;
}

/* ============================================
   Price Filter
   ============================================ */

.price-filter {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-slider-container {
    position: relative;
    height: 6px;
    background-color: var(--light-gray);
    border-radius: 3px;
    margin: 20px 0;
}

.price-slider {
    position: absolute;
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    z-index: 2;
    pointer-events: none;
}

.price-slider::-webkit-slider-thumb {
    pointer-events: all;
}

.price-slider::-moz-range-thumb {
    pointer-events: all;
}

/* Make min slider have higher z-index so it's clickable */
#priceMin {
    z-index: 3;
}

#priceMax {
    z-index: 2;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-purple);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-pink);
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-purple);
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.price-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: var(--secondary-pink);
}

.price-slider-track {
    position: absolute;
    height: 6px;
    background: linear-gradient(to right, var(--primary-purple), var(--secondary-pink));
    border-radius: 3px;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
    transition: left 0.1s ease, width 0.1s ease;
}

.price-range-display {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
    text-align: center;
    padding: 10px;
    background-color: var(--light-gray);
    border-radius: 8px;
}

.price-range-display span {
    color: var(--primary-purple);
}

/* ============================================
   Main Content
   ============================================ */

.shop-main-content {
    flex: 1;
    min-width: 0;
}

.shop-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--light-gray);
}

.results-count {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

.shop-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-dropdown {
    padding: 12px 40px 12px 16px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: linear-gradient(to bottom, var(--white) 0%, #fafafa 100%);
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sort-dropdown:hover {
    border-color: var(--primary-purple);
    background: linear-gradient(to bottom, #f8f8f8 0%, var(--white) 100%);
    box-shadow: 0 2px 6px rgba(88, 45, 78, 0.1);
}

.sort-dropdown:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(88, 45, 78, 0.1), 0 2px 6px rgba(88, 45, 78, 0.15);
}

.view-toggle {
    display: flex;
    gap: 8px;
    background-color: var(--light-gray);
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background-color: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-btn:hover {
    color: var(--primary-purple);
    background-color: var(--white);
}

.view-btn.active {
    background-color: var(--primary-purple);
    color: var(--white);
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Products Grid (Shop Page)
   ============================================ */

.products-grid.shop-products-grid,
.shop-products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px;
    width: 100%;
    grid-auto-rows: auto;
}

.shop-products-grid .product-card-link[style*="display: none"] {
    display: none !important;
}

.products-grid.shop-products-grid.list-view,
.shop-products-grid.list-view {
    grid-template-columns: 1fr !important;
}

.shop-products-grid .product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    min-width: 0;
}

.shop-products-grid .product-card-link[style*="display: none"],
.shop-products-grid .product-card-link[style*="display:none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.shop-products-grid.list-view .product-card-link .product-card {
    display: flex;
    flex-direction: row;
    gap: 30px;
    max-width: 100%;
}

.shop-products-grid.list-view .product-image {
    width: 300px;
    flex-shrink: 0;
}

.shop-products-grid.list-view .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================
   Product Card Hover Effects (Shop Page)
   ============================================ */

.shop-products-grid .product-image {
    position: relative;
    overflow: hidden;
    background-color: var(--light-gray);
    border-radius: 12px;
    aspect-ratio: 1;
    cursor: zoom-in;
}

.shop-products-grid .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shop-products-grid .product-main-img {
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: transform;
}

.shop-products-grid .product-hover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: transform, opacity;
    pointer-events: none;
}

.shop-products-grid .product-card:hover .product-main-img {
    opacity: 0;
}

.shop-products-grid .product-card:hover .product-hover-img {
    opacity: 1;
}

.shop-products-grid .product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    z-index: 1;
}

.shop-products-grid .product-card:hover .product-overlay {
    opacity: 1;
}

.shop-products-grid .product-icons {
    display: flex;
    gap: 12px;
    position: absolute;
    top: 15px;
    right: 15px;
}

.shop-products-grid .product-action-btn {
    margin-top: auto;
    margin-bottom: 20px;
}

/* ============================================
   Notification System
   ============================================ */

.shop-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-purple);
    color: var(--white);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 350px;
}

.shop-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Product Icon Active State
   ============================================ */

.shop-products-grid .product-icon-btn.active {
    background-color: var(--primary-purple);
    color: var(--white);
}

.shop-products-grid .product-icon-btn.active svg {
    fill: var(--white);
    stroke: var(--white);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .shop-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .shop-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
    
    .products-grid.shop-products-grid,
    .shop-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    
    .products-grid.shop-products-grid.list-view,
    .shop-products-grid.list-view {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767px) {
    .shop-page {
        padding: 20px 0 60px;
    }
    
    .shop-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .shop-controls {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .sort-dropdown {
        flex: 1;
        min-width: 150px;
    }
    
    .view-toggle {
        order: 3;
    }
    
    /* Mobile Filter Toggle Button */
    .filter-toggle-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: linear-gradient(135deg, var(--primary-purple) 0%, #6b4470 100%);
        color: var(--white);
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }
    
    .filter-toggle-btn:hover {
        background: linear-gradient(135deg, #6b4470 0%, var(--primary-purple) 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(88, 45, 78, 0.3);
    }
    
    .filter-toggle-btn svg {
        width: 18px;
        height: 18px;
        transition: transform 0.3s ease;
    }
    
    .filter-toggle-btn.active svg {
        transform: rotate(180deg);
    }
    
    /* Hide sidebar by default on mobile */
    .shop-sidebar {
        display: none;
        width: 100%;
        position: static;
        max-height: none;
        margin-bottom: 20px;
        padding: 20px 15px;
    }
    
    .shop-sidebar.mobile-active {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .shop-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .shop-products-grid.list-view {
        grid-template-columns: 1fr !important;
    }
    
    .shop-products-grid.list-view .product-card-link .product-card {
        flex-direction: column;
    }
    
    .shop-products-grid.list-view .product-image {
        width: 100%;
    }
    
    .filter-section {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }
    
    .filter-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .price-range-display {
        font-size: 14px;
        padding: 8px;
    }
}

/* Desktop - Show sidebar and hide toggle button */
@media (min-width: 768px) {
    .filter-toggle-btn {
        display: none;
    }
    
    .shop-sidebar {
        display: block !important;
    }
}

/* ============================================
   Stock Status Badge
   ============================================ */

.product-stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.product-stock-badge.stock-in {
    background-color: rgba(16, 185, 129, 0.95);
    color: white;
}

.product-stock-badge.stock-out {
    background-color: rgba(239, 68, 68, 0.95);
    color: white;
}

.product-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.product-action-btn.disabled:hover {
    background-color: var(--primary-purple);
    transform: none;
}

/* RTL Support for Shop Page Animations */
body[dir="rtl"] .shop-products-grid .product-card:hover,
body.rtl .shop-products-grid .product-card:hover {
    transform: translateY(-5px) scale(1) !important;
}

body[dir="rtl"] .shop-products-grid .product-card:hover .product-main-img,
body.rtl .shop-products-grid .product-card:hover .product-main-img {
    opacity: 0 !important;
}

body[dir="rtl"] .shop-products-grid .product-card:hover .product-hover-img,
body.rtl .shop-products-grid .product-card:hover .product-hover-img {
    opacity: 1 !important;
}

body[dir="rtl"] .shop-products-grid .product-card:hover .product-overlay,
body.rtl .shop-products-grid .product-card:hover .product-overlay {
    opacity: 1 !important;
}

body[dir="rtl"] .shop-products-grid .product-image img,
body.rtl .shop-products-grid .product-image img {
    transition: opacity 0.4s ease, transform 0.4s ease !important;
}

body[dir="rtl"] .shop-products-grid .product-overlay,
body.rtl .shop-products-grid .product-overlay {
    transition: opacity 0.3s ease !important;
}

body[dir="rtl"] .shop-products-grid .product-card,
body.rtl .shop-products-grid .product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

