/* =========================
   PRODUCT PAGES - MODERN CLEAN UI
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f7fa;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* =========================
   PRODUCTS PAGE LAYOUT
========================= */

.products-page-container {
    background: #f5f7fa;
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

.products-layout {
    display: flex;
    gap: 40px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
}

/* =========================
   FILTERS SIDEBAR - CLEAN DESIGN
========================= */

.filters-toggle {
    display: none;
    width: 100%;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.filters-toggle:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 62, 80, 0.3);
}

.filters-sidebar {
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    position: sticky;
    top: 100px;
    border: 1px solid #e8ecf0;
}

.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e8ecf0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    margin: 0;
}

.filters-header h3 {
    font-size: 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters-header h3 i {
    font-size: 18px;
}

.clear-filters-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#filterForm {
    padding: 24px;
}

.filter-section {
    margin-bottom: 32px;
    padding: 0;
    background: transparent;
    border: none;
}

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

.filter-section h4 {
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8ecf0;
}

.filter-section h4 i {
    color: #667eea;
    font-size: 14px;
    width: 18px;
    text-align: center;
}

/* Price Range Filter */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.price-input-wrapper {
    position: relative;
    flex: 1;
}

.price-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #2d3748;
    -moz-appearance: textfield;
}

.price-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #f7fafc;
}

.price-input-wrapper input::-webkit-outer-spin-button,
.price-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.price-spinner {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-spinner button {
    width: 20px;
    height: 14px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.price-spinner button:hover {
    background: #667eea;
    color: white;
}

.price-inputs span {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-top: 10px;
    padding: 10px 14px;
    background: #f7fafc;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* Brand Filter */
.brand-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.brand-checkboxes::-webkit-scrollbar {
    width: 4px;
}

.brand-checkboxes::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.brand-checkboxes::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    margin-bottom: 4px;
}

.checkbox-label:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateX(4px);
}

.checkbox-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-label span {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
    flex: 1;
}

.checkbox-label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
    font-weight: 600;
}

.checkbox-label:has(input[type="radio"]:checked) span {
    color: #667eea;
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: #ffffff;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.sort-select:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #f7fafc;
}

/* =========================
   MAIN PRODUCTS AREA
========================= */

.products-main {
    flex: 1;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.products-header-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e8ecf0 !important;
}

.products-header-section h1 {
    font-size: 32px;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.products-header-section .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

.products-header-section .input-group-text {
    border-color: #dee2e6;
    transition: all 0.3s ease;
}

.products-header-section .form-control:focus + .input-group-text,
.products-header-section .form-control:focus ~ .input-group-text {
    border-color: #667eea;
}

.products-header-section .input-group-text i {
    transition: color 0.3s ease;
}

.products-header-section .form-control:focus ~ .input-group-text i {
    color: #667eea !important;
}

/* =========================
   PRODUCT GRID - MODERN CARDS
========================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
    padding: 0;
}

.product-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 0;
    text-align: center;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8ecf0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.product-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    flex: 1;
    cursor: pointer;
    outline: none !important;
    border: none !important;
}

.product-link * {
    color: inherit !important;
    text-decoration: none !important;
}

/* Product Image */
.product-image {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    width: 100%;
    padding: 0;
    margin: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

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

.out-of-stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Product Info */
.product-info {
    text-align: left;
    flex: 1;
    padding: 20px 20px 12px;
    background: #ffffff;
    position: relative;
    z-index: 2;
}

.product-brand {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 6px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.product-flavour {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.product-size {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 400;
}

.product-price {
    font-size: 24px;
    font-weight: 800;
    color: #10b981;
    margin: 12px 0 0;
    letter-spacing: -0.5px;
}

/* Product Info Layout - New Structure */
.product-line-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.product-line-1 .product-brand {
    margin-bottom: 0;
    font-weight: 700;
}

.product-line-1 .product-flavour {
    font-size: 14px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0;
}

.product-made-in {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 4px;
    font-weight: 500;
}

.product-pack {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 400;
}

.product-line-5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 10px;
}

.product-stock {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.product-line-5 .product-price {
    margin: 0;
    font-size: 20px;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 0;
    margin-top: 0;
    align-items: stretch;
    z-index: 10;
    position: relative;
    padding: 0 20px 20px;
    background: #ffffff;
}

/* Product Quantity Wrapper */
.product-quantity-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.product-quantity-wrapper .qty-controls {
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    width: 100%;
}

.product-quantity-wrapper .qty-btn {
    background: #f7fafc;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2d3748;
    font-size: 12px;
    flex-shrink: 0;
}

.product-quantity-wrapper .qty-btn:hover {
    background: #e9ecef;
    color: #667eea;
}

.product-quantity-wrapper .qty-btn:active {
    transform: scale(0.95);
}

.product-quantity-wrapper .qty-btn.minus {
    border-right: 2px solid #e2e8f0;
}

.product-quantity-wrapper .qty-btn.plus {
    border-left: 2px solid #e2e8f0;
}

.product-qty-input {
    flex: 1;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    background: white;
    outline: none;
    -moz-appearance: textfield;
}

.product-qty-input::-webkit-outer-spin-button,
.product-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-cart {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-add-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-add-cart:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-cart:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
    color: #94a3b8;
}

/* No Products Message */
.no-products-message {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

.no-products-message i {
    font-size: 72px;
    color: #cbd5e0;
    margin-bottom: 24px;
}

.no-products-message h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: #1a202c;
    font-weight: 700;
}

.no-products-message p {
    font-size: 16px;
    margin-bottom: 32px;
    color: #64748b;
}

.btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* =========================
   RESPONSIVE DESIGN
========================= */

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 24px;
    }
    
    .product-image {
        height: 260px;
        padding: 0;
    }
}

@media (max-width: 1024px) {
    .products-layout {
        flex-direction: column;
        gap: 24px;
    }
    
    .filters-sidebar {
        width: 100%;
        position: static;
        max-height: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .products-page-container {
        padding: 20px 0;
    }
    
    .products-layout {
        padding: 0 16px;
        gap: 20px;
    }
    
    .filters-toggle {
        display: flex;
    }
    
    .filters-sidebar {
        width: 100%;
        padding: 0;
        position: static;
        max-height: none;
        order: 2;
    }
    
    .filters-sidebar.hidden {
        display: none;
    }
    
    .products-main {
        order: 1;
    }
    
    .products-header-section {
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .products-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .products-header-section .header-right {
        width: 100%;
    }
    
    .products-header-section .header-right {
        width: 100%;
        margin-top: 15px;
    }
    
    .products-header-section .header-right .input-group {
        width: 100% !important;
    }
    
    .products-header-section h1 {
        font-size: 24px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-image {
        height: 220px;
        padding: 0;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-brand {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .product-actions {
        padding: 0 16px 16px;
    }
    
    .btn-add-cart {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .product-quantity-wrapper .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    .product-qty-input {
        height: 32px;
        font-size: 14px;
    }
}

@media (min-width: 769px) {
    .filters-toggle {
        display: none !important;
    }
}

/* =========================
   ANIMATIONS
========================= */

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

.product-card {
    animation: fadeIn 0.4s ease-out;
}

/* Loading State */
.products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}
