/* Products Page Styles - Swarovski Design */

/* CSS Variables */
:root {
    --primary-color: #212121;
    --secondary-color: #666;
    --accent-color: #FFD700;
    --light-gray: #f5f5f5;
    --border-color: #e0e0e0;
    --font-primary: 'Lato', sans-serif; /* Updated to Lato for all product details */
    --font-secondary: 'Lato', sans-serif; /* Updated to Lato for body text */
}

/* CRITICAL: Override global body constraints for products page */
body[data-page="products"] {
    overflow-x: visible !important; /* Allow horizontal overflow for wide grid */
    max-width: none !important;
    width: 100% !important;
}

/* Page Layout */
.products-main {
    padding-top: 0; /* Remove extra padding - filter bar will start right after navigation */
    min-height: 100vh;
    background: #f5f5f5 !important;
    width: 100% !important;
    max-width: none !important; /* Remove any max-width constraints */
    position: relative;
    overflow-x: visible !important; /* Allow horizontal overflow for wide grid */
}

.products-container {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Center all child elements */
    overflow: visible !important; /* Ensure no clipping */
}

/* Override global container styles for products page */
.products-main .container {
    max-width: none !important; /* Remove max-width constraint */
    margin: 0 auto !important; /* Center the container */
    padding: 0 !important; /* Remove padding constraint */
    width: 100% !important; /* Use full width */
}

/* CRITICAL: Override global container constraints for products page */
.products-main .container,
.filter-bar .container,
.results-bar .container,
.products-container .container {
    max-width: 100% !important; /* Use full width */
    width: 100% !important; /* Allow full width */
    margin: 0 !important; /* Remove auto centering */
    padding: 0 !important; /* Remove padding constraints */
}

/* Ensure filter and results containers can accommodate 4-card grid */
.filter-bar .container,
.results-bar .container {
    max-width: 100% !important; /* Use full width */
    margin: 0 !important; /* Remove auto centering */
    padding: 0 !important; /* Remove padding constraints */
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-family: var(--font-primary);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    font-family: var(--font-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Breadcrumb - REMOVED CONFLICTING STYLES - Now handled by module CSS */

/* Filter Bar - White Background */
.filter-bar {
    background: white !important;
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 12px 40px !important; /* Internal padding for content */
    margin: 0 !important;
    width: 100vw !important; /* Use full viewport width */
    max-width: 100% !important; /* Use full width */
    display: block !important;
    position: relative !important;
    z-index: 10 !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
}

.filter-content {
    display: flex !important;
    align-items: center;
    justify-content: space-between; /* This spreads items to left and right */
    width: 100%; /* Use full width */
    margin: 0; /* Remove auto centering */
    padding: 0; /* Remove padding since we're using full width */
    box-sizing: border-box;
    flex: 1; /* Take up all available space */
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 15px; /* Increased gap for better spacing */
    justify-content: flex-start; /* Align to left */
    flex: 0 0 auto; /* Don't shrink */
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 25px; /* Increased gap for better spacing */
    justify-content: flex-end; /* Align to right */
    margin-left: auto; /* Push to right side */
    flex: 0 0 auto; /* Don't shrink */
}

.filter-item {
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Available Online Toggle - Exact Match */
.toggle-filter .toggle-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 15px; /* Increased font size */
    font-weight: 500; /* Slightly bolder */
    color: #333 !important;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    white-space: nowrap;
    text-align: left; /* Ensure left alignment */
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #333;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Filter Dropdown Buttons - Exact Match */
.filter-dropdown {
    display: flex !important;
    align-items: center;
    gap: 8px; /* Increased gap */
    padding: 10px 16px; /* Increased padding */
    background: transparent !important;
    border: none !important;
    font-size: 15px; /* Increased font size */
    color: #333 !important;
    font-family: 'Lato', sans-serif;
    font-weight: 500; /* Slightly bolder */
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}

.filter-dropdown:hover {
    color: #000;
}

.filter-dropdown i {
    font-size: 12px; /* Increased icon size */
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.dropdown-filter.active .filter-dropdown i {
    transform: rotate(180deg);
}

/* Dropdown Menu - Clean Style */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 9999999 !important; /* Much higher z-index to appear above everything */
    display: none; /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    min-width: 180px; /* Increased minimum width */
    max-height: 200px;
    overflow-y: auto;
    pointer-events: auto !important; /* Ensure dropdown can receive mouse events */
}

.dropdown-filter.active .dropdown-menu {
    display: block !important; /* Show dropdown when active */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important; /* Ensure dropdown can receive mouse events */
}

.dropdown-menu a {
    display: block;
    padding: 12px 18px; /* Increased padding */
    color: #666;
    text-decoration: none;
    font-size: 15px; /* Increased font size */
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    transition: color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    background: transparent;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: transparent;
    color: #000;
}

/* Color Dropdown Specific Styles - Exact Match with Image */
.color-dropdown-menu {
    min-width: 280px !important;
    max-height: 300px !important;
    padding: 16px !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    background: white !important;
    overflow-y: auto !important;
}

.color-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    border-radius: 0;
    transition: color 0.2s ease;
    background: transparent;
}

.color-option:hover {
    background: transparent;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 0;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-name {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    flex: 1;
    white-space: nowrap;
}

.color-count {
    font-size: 12px;
    color: #666;
    font-weight: 400;
    white-space: nowrap;
}

.color-option:hover .color-name,
.color-option:hover .color-count {
    color: #000;
}

/* Color Swatch Definitions - Real Jewelry Colors */
.color-swatch.yellow-gold {
    background: #ffd700;
    border: 1px solid #d4af37;
}

.color-swatch.white-gold {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.color-swatch.rose-gold {
    background: #b76e79;
    border: 1px solid #a0522d;
}

.color-swatch.antique-gold {
    background: #cd853f;
    border: 1px solid #b8860b;
}

.color-swatch.rhodium-plated {
    background: #c0c0c0;
    border: 1px solid #a9a9a9;
}

.color-swatch.platinum {
    background: linear-gradient(45deg, #e5e4e2, #bcc6cc);
}

.color-swatch.silver {
    background: linear-gradient(45deg, #c0c0c0, #d3d3d3);
}

.color-swatch.diamond {
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Stone Swatch Definitions - Real Gemstone Colors */
.stone-swatch.diamond {
    background: #ffffff;
    border: 1px solid #e0e0e0;
}

.stone-swatch.ruby {
    background: #e0115f;
    border: 1px solid #b91c3c;
}

.stone-swatch.emerald {
    background: #50c878;
    border: 1px solid #228b22;
}

.stone-swatch.sapphire {
    background: #0f52ba;
    border: 1px solid #000080;
}

.stone-swatch.pearl {
    background: #f0f8ff;
    border: 1px solid #e6e6fa;
}

.stone-swatch.coral {
    background: #ff7f50;
    border: 1px solid #ff6347;
}

.stone-swatch.cat-eye {
    background: #8b4513;
    border: 1px solid #654321;
}

.stone-swatch.hessonite {
    background: #ff8c00;
    border: 1px solid #ff7f00;
}

.stone-swatch.topaz {
    background: #ffd700;
    border: 1px solid #ffb347;
}

.stone-swatch.amethyst {
    background: #9966cc;
    border: 1px solid #8a2be2;
}

.stone-swatch.garnet {
    background: #8b0000;
    border: 1px solid #800000;
}

.stone-swatch.aquamarine {
    background: #7fffd4;
    border: 1px solid #40e0d0;
}

.stone-swatch.peridot {
    background: #90ee90;
    border: 1px solid #32cd32;
}

.stone-swatch.moonstone {
    background: #f0f8ff;
    border: 1px solid #e6e6fa;
}

.stone-swatch.opal {
    background: linear-gradient(45deg, #ff69b4, #87ceeb, #98fb98, #dda0dd);
    border: 1px solid #c0c0c0;
}

.color-swatch.oxidized {
    background: #2f4f4f;
}

.color-swatch.enamel {
    background: linear-gradient(45deg, #ff69b4, #87ceeb, #98fb98, #dda0dd);
}

.color-swatch.meenakari {
    background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff, #ffff00);
}

.color-swatch.kundan {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-swatch.polki {
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-swatch.jadau {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-swatch.thewa {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.color-swatch.lac {
    background: #8b4513;
}

.color-swatch.ivory {
    background: #fffff0;
}

.color-swatch.wood {
    background: #8b4513;
}

.color-swatch.ceramic {
    background: #f5f5dc;
}

.color-swatch.glass {
    background: linear-gradient(45deg, #87ceeb, #98fb98, #dda0dd);
}

.color-dropdown-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.color-close-btn {
    background: white;
    border: 1px solid #000;
    color: #000;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-close-btn:hover {
    background: #000;
    color: white;
}

/* Stones Dropdown Specific Styles */
.stones-dropdown-menu {
    min-width: 280px !important;
    max-height: 400px !important;
    padding: 16px !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    background: white !important;
    overflow-y: auto !important;
}

.stones-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stone-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    border-radius: 0;
    transition: color 0.2s ease;
    background: transparent;
}

.stone-option:hover {
    background: transparent;
}

.stone-swatch {
    width: 20px;
    height: 20px;
    border-radius: 0;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stone-name {
    font-size: 14px;
    color: #666;
    font-weight: 400;
    flex: 1;
    white-space: nowrap;
}

.stone-count {
    font-size: 12px;
    color: #666;
    font-weight: 400;
    white-space: nowrap;
}

.stone-option:hover .stone-name,
.stone-option:hover .stone-count {
    color: #000;
}

.stones-dropdown-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.stones-close-btn {
    background: white;
    border: 1px solid #000;
    color: #000;
    padding: 8px 16px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stones-close-btn:hover {
    background: #000;
    color: white;
}

/* Search and Sort - MOVED TO /public/css/header.css */

.sort-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: var(--secondary-color);
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Results Bar - Clean Style */
.results-bar {
    background: #F0EEE5;
    border-bottom: 0px solid #e0e0e0;
    padding: 12px 0;
    margin-bottom: 30px;
    width: 100%; /* Use full width */
    margin-left: 0; /* Remove centering offset */
}

/* Mobile overflow guard: avoid 100vw on small screens to prevent horizontal scroll */
@media (max-width: 767px) {
    .filter-bar,
    .results-bar {
        width: 100% !important;
        margin-left: 0 !important;
        overflow: hidden !important;
    }
}

.results-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%; /* Use responsive width */
    margin: 0 auto; /* Center the content */
    padding: 0 40px; /* Add horizontal padding to match products grid */
    max-width: 1600px; /* Match products grid max-width */
    box-sizing: border-box;
}

.results-left {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: flex-start; /* Align to left */
    flex-wrap: wrap; /* Allow wrapping */
}

.results-count {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    font-family: 'Lato', sans-serif;
}

.clear-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 14px;
    color: #666;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: underline;
}

.clear-filters:hover {
    color: #000;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 16px;
    font-size: 12px;
    color: #333;
    font-family: 'Lato', sans-serif;
    cursor: pointer; /* Make entire chip clickable */
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: #e0e0e0;
    color: #000;
}

.filter-tag i {
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.filter-tag:hover i {
    opacity: 1;
}

.results-right {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align to right */
}

.sort-dropdown {
    position: relative;
}

.sort-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: #333;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: color 0.2s ease;
}

.sort-button:hover {
    color: #000;
}

.sort-button i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.sort-dropdown.active .sort-button i {
    transform: rotate(180deg);
}

.sort-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Products Grid */
.products-content {
    margin-bottom: 60px;
}

/* CRITICAL: Fixed 4-card layout with 8px gaps */
.products-main .products-container .products-grid,
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Exactly 4 equal columns */
    gap: 8px !important; /* Exactly 8px gap as requested */
    margin: 0 auto 30px auto !important; /* Center the grid */
    width: 100% !important; /* Use full available width */
    max-width: 100% !important; /* Prevent overflow */
    padding: 0 !important; /* No padding on grid itself */
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Products grid container - EXACTLY 40px padding on both sides */
.products-main .products-container {
    max-width: 1600px !important; /* Match filter/results container width */
    margin: 0 auto !important; /* Center the container */
    padding: 0 40px !important; /* EXACTLY 40px padding on both sides */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Override any global container styles that might interfere */
.products-main .container {
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding: 0 40px !important; /* EXACTLY 40px padding on both sides */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* CRITICAL: Override responsive.css rules that set padding: 0 */
.products-main .filter-content,
.products-main .results-content {
    padding: 0 40px !important; /* EXACTLY 40px padding on both sides */
    max-width: 1600px !important;
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure main container doesn't overflow */
.products-main {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: visible !important; /* Allow carousel arrows to be visible */
    box-sizing: border-box !important;
}

/* Remove fixed widths that cause overflow - let grid handle sizing */
@media (min-width: 1200px) {
    .products-grid {
        /* Remove fixed widths - let container and grid handle sizing */
        width: 100% !important;
        max-width: 100% !important;
    }

    .products-grid .product-card {
        /* Remove fixed widths - let grid columns handle sizing */
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/* Prevent horizontal overflow at page level */
/* Scope horizontal overflow to products page container to avoid global conflicts */
.products-main {
    overflow-x: visible; /* Allow arrows to be visible within products page */
    max-width: 100%;
    box-sizing: border-box;
}

/* DEBUG: Visual indicator - REMOVED */

/* Product Card - Grid-based responsive layout - REMOVED CONFLICTING STYLES */

/* Remove card hover effects - REMOVED CONFLICTING STYLES */

/* Responsive adjustments - maintain EXACTLY 40px padding on all screen sizes */
@media (max-width: 1600px) {
    .products-main .products-container,
    .products-main .container,
    .products-main .filter-content,
    .products-main .results-content {
        padding: 0 40px !important; /* Maintain exactly 40px padding */
    }
}

@media (max-width: 1400px) {
    .products-main .products-container,
    .products-main .container,
    .products-main .filter-content,
    .products-main .results-content {
        padding: 0 40px !important; /* Maintain exactly 40px padding */
    }
}

@media (max-width: 1200px) {
    .products-main .products-container,
    .products-main .container,
    .products-main .filter-content,
    .products-main .results-content {
        padding: 0 40px !important; /* Maintain exactly 40px padding */
    }
}

@media (max-width: 1000px) {
    .products-main .products-container,
    .products-main .container,
    .products-main .filter-content,
    .products-main .results-content {
        padding: 0 40px !important; /* Maintain exactly 40px padding */
    }
}

@media (max-width: 800px) {
    .products-main .products-container,
    .products-main .container,
    .products-main .filter-content,
    .products-main .results-content {
        padding: 0 40px !important; /* Maintain exactly 40px padding */
    }
}

/* Mobile breadcrumb styles removed - now handled by module CSS */

.product-image-container {
    position: relative;
    aspect-ratio: 1.2; /* Match carousel aspect ratio exactly */
    overflow: hidden;
    background: white;
    min-height: 350px; /* Match carousel minimum height exactly */
    flex: 1; /* Take up available space like carousel */
    flex-grow: 2; /* Maximum growth to take up more space like carousel */
    flex-shrink: 0; /* Don't allow shrinking like carousel */
    width: 100%; /* Ensure full width like carousel */
    display: flex; /* Add flex display to ensure proper sizing like carousel */
    margin: 0; /* Override any margins like carousel */
    padding: 0; /* Override any padding like carousel */
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.product-image.secondary {
    opacity: 0;
}

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

.product-card:hover .product-image.secondary {
    opacity: 1;
}

.product-wishlist {
    position: absolute;
    top: 12px;
    right: 12px; /* Keep on right side as originally intended */
    background: transparent; /* Transparent background */
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 0; /* Remove circular background */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999; /* Grey color for normal state */
    z-index: 3; /* Ensure it's above other elements */
}

.product-wishlist:hover {
    background: transparent; /* No background change on hover */
    color: #999; /* Keep grey on hover */
}

.product-wishlist.active {
    background: transparent; /* Keep transparent when active */
    color: #FF0000; /* Red when favorited */
}

/* Heart icon specific styling */
.product-wishlist i {
    font-size: 18px;
    transition: color 0.3s ease;
}

.product-wishlist i.far {
    color: #999; /* Grey for unfavorited (outline heart) */
}

.product-wishlist i.fas {
    color: #FF0000; /* Red for favorited (filled heart) */
}

.product-wishlist:hover i {
    color: #999; /* Keep grey on hover, no red outline */
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px; /* Keep NEW badge on left side */
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: var(--font-primary);
    z-index: 2;
}

.product-info {
    padding: 12px 16px 16px 16px; /* Match homepage carousel spacing */
    display: flex;
    flex-direction: column;
    gap: 4px; /* Consistent 4px spacing between all elements */
    min-width: 0; /* Allow flex items to shrink below their content size */
    width: 100%; /* Ensure full width */
}

/* Color dots repositioned to bottom-left of image area */
.product-colors-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    z-index: 2; /* Above image but below wishlist button */
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8); /* White border for visibility on images */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Subtle shadow for better visibility */
}

/* Remove old product-colors class (no longer used) */
.product-colors {
    display: none;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0; /* Remove margin - using flex gap instead */
    font-family: var(--font-primary);
    line-height: 1.2; /* Tighter line height like homepage */
}

/* Product Description - Force single line truncation with maximum specificity */
.products-main .products-grid .product-card .product-description,
.products-main .product-card .product-description,
.products-grid .product-card .product-description,
.product-card .product-info .product-description,
.product-card .product-description,
.products-main .product-description,
.products-grid .product-description,
p.product-description {
    font-size: 16px !important;
    color: var(--secondary-color) !important;
    margin: 0 !important; /* Remove margin - using flex gap instead */
    font-family: var(--font-primary) !important;
    line-height: 1.2 !important; /* Tighter line height */
    white-space: nowrap !important; /* Force single line */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important; /* Override any flex/webkit-box */
    -webkit-line-clamp: unset !important; /* Remove multi-line clamp */
    line-clamp: unset !important; /* Standard property for compatibility */
    -webkit-box-orient: unset !important; /* Remove webkit box orientation */
    -webkit-box: unset !important; /* Remove webkit-box display */
    text-align: center !important;
    width: 100% !important; /* Ensure full width for proper truncation */
    max-width: 100% !important; /* Prevent overflow */
    min-width: 0 !important; /* Allow shrinking for ellipsis */
    box-sizing: border-box !important; /* Include padding in width calculation */
    flex-shrink: 1 !important; /* Allow flex item to shrink */
    flex-grow: 0 !important; /* Don't allow flex item to grow */
    flex-basis: auto !important; /* Use content size as basis */
}

/* Critical fix for text truncation - highest specificity */
.product-card .product-info p.product-description,
.product-info p.product-description,
div.product-info p.product-description {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    /* Force container constraints */
    contain: layout !important;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Reduced gap for tighter spacing */
    font-family: var(--font-primary);
    margin: 0; /* Remove margin - using flex gap instead */
    flex-wrap: nowrap; /* Prevent wrapping to keep all elements on same line */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow if needed */
}

.current-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0; /* Prevent shrinking */
}

.mrp-price {
    font-size: 14px;
    color: var(--secondary-color);
    text-decoration: line-through;
    font-weight: 400;
    flex-shrink: 0; /* Prevent shrinking */
}

.discount-percentage {
    font-size: 14px;
    color: #e74c3c; /* Red color for discount */
    font-weight: 500;
    flex-shrink: 0; /* Prevent shrinking */
}

.product-price-note {
    font-size: 12px;
    color: var(--secondary-color);
    margin: -2px 0 0 0; /* Negative top margin to bring closer to price */
    font-family: var(--font-primary);
    line-height: 1.2; /* Tighter line height */
}

/* Add to Bag Button Styling - Products Page */
.product-card .add-to-bag-btn {
    /* Exact style from reference image: Full black button */
    background: #000 !important; /* Black background */
    border: none !important; /* No border */
    color: white !important; /* White text */
    padding: 15px 20px !important; /* Proper button padding */
    width: 100% !important; /* Full width as per reference */
    max-width: none !important; /* Remove max width restriction */
    min-width: none !important; /* Remove min width restriction */
    font-size: 14px !important; /* Standard font size */
    font-weight: 500 !important; /* Medium font weight */
    border-radius: 0 !important; /* No round borders */
    cursor: pointer;
    display: block !important; /* Block display for full width */
    text-align: center !important; /* Center text */
    margin: 10px 0 0 0 !important; /* Top margin only */
    text-decoration: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    font-family: var(--font-body) !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
}

/* Hover state: Slightly lighter black */
.product-card .add-to-bag-btn:hover {
    background: #333 !important; /* Slightly lighter on hover */
    color: white !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Checkout state: Same black style */
.product-card .add-to-bag-btn.checkout-state {
    background: #000 !important;
    color: white !important;
}

.product-card .add-to-bag-btn.checkout-state:hover {
    background: #333 !important;
    color: white !important;
}

/* Pagination - Fixed spacing and functionality */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 40px 0; /* Consistent top and bottom margins */
    padding: 0;
}

.pagination.hidden {
    display: none; /* Hide entire pagination when only one page */
}

.pagination-dots {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white; /* White for non-selected pages */
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #ccc; /* Light border for visibility */
}

.dot:hover {
    background: #f0f0f0;
    transform: scale(1.1);
    border-color: #999;
}

.dot.active {
    background: black; /* Black for selected page */
    border-color: black;
    transform: scale(1.2);
}

.pagination-prev {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    margin-right: 8px;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-prev:hover:not(:disabled) {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.pagination-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-next {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-next:hover:not(:disabled) {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.pagination-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



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

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* ===== Sharp corners override (products page) ===== */
.products-grid .product-card,
.products-grid .product-image-container,
.products-grid .product-image,
.products-grid .product-image.primary,
.products-grid .product-image.secondary {
    border-radius: 0 !important;
}


