/* Products Page Styles - Using Beauty Industry Color Theme */
/* Color variables are inherited from main style.css */

/* Additional text colors for products page */
:root {
    --text-primary: var(--charcoal);
    --text-secondary: var(--dark-gray);
    --text-muted: var(--medium-gray);
    --border-color: #E8DDD4;
}

/* Enhanced Page Typography */
body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Collapsible Filter Section */
.filter-toggle-container {
    background: linear-gradient(135deg, var(--off-white) 0%, var(--light-cream) 100%);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.filter-toggle-header:hover { color: inherit; }

.filter-toggle-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-toggle-icon {
    font-size: 1.125rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.filter-toggle-icon.rotated {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.filter-content.expanded {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    padding-top: 1.5rem;
}

.filter-stats {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Enhanced Filter System */
.filter-system-enhanced {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: visible;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-label i {
    color: var(--primary-color);
    font-size: 1rem;
}

.filter-input, .filter-select {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    background: var(--white);
}

.filter-input:focus, .filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
    outline: none;
}

.filter-dropdown {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    background: var(--white);
    transition: var(--transition-fast);
}

.filter-dropdown:hover { border-color: var(--border-color); }

.filter-dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-width: 300px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modern Toast Notification System */
.location-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.location-toast {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 10px;
    overflow: hidden;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.location-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.location-toast.success {
    border-left-color: var(--success-color);
}

.location-toast.error {
    border-left-color: var(--danger-color);
}

.location-toast.warning {
    border-left-color: var(--warning-color);
}

.location-toast.info {
    border-left-color: var(--info-color);
}

.toast-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-cream);
}

.toast-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.toast-icon.loading {
    background: rgba(212, 165, 116, 0.1);
    color: var(--primary-color);
}

.toast-icon.success {
    background: rgba(127, 176, 105, 0.1);
    color: var(--success-color);
}

.toast-icon.error {
    background: rgba(231, 111, 81, 0.1);
    color: var(--danger-color);
}

.toast-icon.warning {
    background: rgba(244, 162, 97, 0.1);
    color: var(--warning-color);
}

.toast-icon.info {
    background: rgba(184, 149, 106, 0.1);
    color: var(--info-color);
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toast-close:hover {
    background: var(--border-color);
}

.toast-body {
    padding: 12px 16px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Product Cards - Enhanced Design Matching Home Services */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.product-card-wrapper {
    position: relative;
    height: 100%;
}

/* Unified Luxury Card Styling */
.product-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6d3b0; /* subtle gold edge */
    overflow: hidden;
    height: 100%;
    transition: box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Remove hover shadow to simplify visuals */
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Product Image */
.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--light-cream);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* No aggressive zoom on hover for clean feel */
.product-card:hover .product-image img { transform: none; }

.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image-overlay { opacity: 0; }

/* Product Badges */
.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 3;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.product-badge.featured {
    background: linear-gradient(135deg, var(--warning-color), #f39c12);
    color: var(--white);
}

.product-badge.out-of-stock {
    background: linear-gradient(135deg, var(--danger-color), #c0392b);
    color: var(--white);
}

.product-badge.low-stock {
    background: rgba(255, 255, 255, 0.9);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    backdrop-filter: blur(4px);
}

/* Product Content */
.product-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.product-category {
    display: inline-block;
    background: rgba(212, 165, 116, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-family: var(--font-body);
}

.product-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* No title color change on hover */
.product-card:hover .product-title { color: inherit; }

.product-description {
    font-family: var(--font-body);
    color: var(--medium-gray);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    flex: 1;
}

/* Product Details */
.product-details {
    margin-bottom: 1.5rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-body);
}

.product-price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price-currency {
    font-size: 0.9rem;
    color: var(--medium-gray);
    font-weight: 500;
}

.product-shop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.product-shop i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.product-shop a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-shop a:hover {
    color: var(--primary-color);
}

.product-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.product-location i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.stock-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stock-indicator.in-stock {
    background: var(--success-color);
}

.stock-indicator.low-stock {
    background: var(--warning-color);
}

.stock-indicator.out-of-stock {
    background: var(--danger-color);
}

/* Product Footer */
.product-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--warm-gray);
}

.product-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-add-to-cart {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-to-cart:hover {
    background: linear-gradient(135deg, var(--primary-dark), #a67c52);
    color: var(--white);
}

.btn-add-to-cart:disabled {
    background: var(--medium-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-view-product {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn-add-to-cart i,
.btn-view-product i {
    font-size: 0.9rem;
}

/* Enhanced Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: var(--white);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(212, 165, 116, 0.05);
}

/* Results Header Enhancement */
.results-header {
    background: linear-gradient(135deg, var(--off-white) 0%, var(--light-cream) 100%);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.results-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.results-count {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Loading Spinner */
.spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--light-cream);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Detect Location Button */
#detectLocationBtn {
    position: relative;
    overflow: hidden;
}

#detectLocationBtn.loading {
    color: transparent;
}

#detectLocationBtn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--light-cream);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Location Status in Dropdown */
.location-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.detecting {
    background: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.status-dot.success {
    background: var(--success-color);
}

.status-dot.error {
    background: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* No Results State */
.no-results {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    border: 2px dashed var(--border-color);
}

.no-results-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Pagination Enhancement */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(212, 165, 116, 0.05);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .location-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .location-toast {
        margin-bottom: 8px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
    
    .product-content {
        padding: 1.25rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-view-product {
        width: 100%;
    }
    
    .filter-toggle-container {
        padding: 1rem;
    }
    
    .results-header {
        padding: 1.5rem;
    }

    .filter-content.expanded {
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-content {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-price {
        font-size: 1.5rem;
    }

    .filter-content.expanded {
        max-height: 85vh;
    }
}
