/* ========================================
   AMERICAN MEAT GALLERY - STYLES
   Version: 2.0
   Description: Clean, organized styles for gallery page
======================================== */

/* ========================================
   IMPORTS & FONTS
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');
/* Font Awesome loaded via <link> tag in index.html with SRI integrity hash */

/* ========================================
   ROOT VARIABLES & RESETS
======================================== */
:root {
    --primary-color: #2c6e7f;
    --secondary-color: #f4a261;
    --hover-color: #1f4b57;
    --accent-red: #bb0000;
    --accent-red-hover: #c01818;
    --text-color: #333;
    --background-color: #f0f4f8;
    --card-background: #ffffff;
    --border-color: #ddd;
    --error-color: #f44336;
    --warning-color: #ffc107;
    --success-color: #4CAF50;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    background: linear-gradient(135deg, var(--background-color) 0%, #e8ecef 100%);
    color: var(--text-color);
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* ========================================
   HEADER & NAVIGATION
======================================== */
header {
    background: var(--card-background);
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

/* Navigation */
nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    text-decoration: none;
    color: var(--primary-color);
    background: white;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
    display: inline-block;
}

nav ul li a:hover {
    background: #d6e9f0;
}

nav ul li a.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

nav ul li a.active:hover {
    background: var(--accent-red);
}

#cart-link i {
    margin-right: 5px;
}

/* Hamburger Menu styles inherited from shared.css */

/* ========================================
   HERO SECTION
======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: 1.2rem;
    margin: 0 0 30px 0;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ========================================
   MAIN GALLERY CONTAINER
======================================== */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: -30px;
    position: relative;
    z-index: 2;
    padding: 40px 20px;
}

/* ========================================
   FILTER CONTROLS
======================================== */
.filters {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 20px;
    background: var(--card-background);
    padding: 15px 15px 5px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.filters-main-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}


.filters-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 180px;
}


.filter-group-with-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 440px;
    min-width: 440px;
}

.filter-group-with-toggle .filter-group {
    flex: 1;
    min-width: 0;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Font Awesome icons for filter labels */
.filter-group label::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 6px;
    color: var(--primary-color);
}

.filter-group label[for="color-filter"]::before { content: '\f53f'; }
.filter-group label[for="product-type-filter"]::before { content: '\f02c'; }
.filter-group label[for="option-type-filter"]::before { content: '\f0c9'; }


.custom-select {
    position: relative;
    width: max-content;
    min-width: 200px;
    max-width: 300px;
}

.select-display {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #f9f9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-display:hover {
    border-color: var(--primary-color);
}

.select-display::after {
    content: '▼';
    font-size: 10px;
    margin-left: 6px;
    flex-shrink: 0;
}

.select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    width: max-content;
    max-width: 300px;
}

.select-options label {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-options label:hover {
    background: #f0f0f0;
}

.select-options input[type="checkbox"] {
    margin-right: 6px;
    flex-shrink: 0;
}

.color-specific-toggle {
    display: flex;
    align-items: center;
    min-width: fit-content;
    flex-shrink: 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: white;
    font-size: 0.75rem;
    margin: 0;
    padding: 6px 10px;
    background: var(--primary-color);
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    white-space: nowrap;
    transition: all 0.3s ease;
}

.toggle-label:hover {
    background: var(--hover-color);
    border-color: var(--hover-color);
}

.toggle-label input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

.toggle-text {
    user-select: none;
}

.color-specific-toggle input[type="checkbox"]:checked + .toggle-text {
    color: white;
    font-weight: 600;
}

.sort-toggle-group {
    display: flex;
    align-items: center;
    min-width: fit-content;
}

.sort-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f5f5f5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
    justify-content: center;
}

.sort-toggle-btn:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.sort-toggle-btn:active {
    transform: translateY(0);
}

.sort-toggle-btn i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sort-text {
    font-size: 0.8rem;
}

/* Reset Filters Link - bottom left */
.reset-filters-link {
    display: flex;
    align-items: center;
}

.reset-filters-link a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.reset-filters-link a:hover {
    color: var(--primary-color);
    background: #f8f9fa;
    border-color: var(--primary-color);
}

.reset-filters-link a i {
    font-size: 0.8rem;
}

/* ========================================
   COLOR CHECKBOX SWATCHES
======================================== */

/* Remove the old color-swatch rule and replace with this: */

.color-option-label {
    display: flex !important;
    align-items: center !important;
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    gap: 10px !important;
}

.color-option-label:hover {
    background: #f0f0f0 !important;
}

/* Custom color checkbox styling */
.color-checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #ddd !important;
    border-radius: 4px !important;
    background-color: var(--swatch-color) !important;
    cursor: pointer !important;
    position: relative !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    transition: all 0.2s ease !important;
}

.color-checkbox:hover {
    border-color: var(--primary-color) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.color-checkbox:focus {
    outline: 2px solid var(--primary-color) !important;
    outline-offset: 2px !important;
}

/* Checkmark styling */
.color-checkbox:checked::after {
    content: '✓' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: var(--checkmark-color) !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.3) !important;
    line-height: 1 !important;
}

.color-checkbox:checked {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 1px var(--primary-color), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Label text styling */
.color-label-text {
    color: var(--text-color) !important;
    font-weight: 500 !important;
    user-select: none !important;
}

/* Special handling for transparent/none colors */
.color-checkbox[style*="transparent"] {
    background: repeating-linear-gradient(
        45deg,
        #f0f0f0,
        #f0f0f0 4px,
        #e0e0e0 4px,
        #e0e0e0 8px
    ) !important;
    border-color: #ccc !important;
}

.color-checkbox[style*="transparent"]:checked::after {
    color: #666 !important;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8) !important;
}

/* Filter option hidden state - maximum specificity to override all other rules */
.select-options label.filter-hidden,
.select-options label.color-option-label.filter-hidden,
#color-filter .select-options label.filter-hidden,
#product-type-filter .select-options label.filter-hidden,
#option-type-filter .select-options label.filter-hidden {
    display: none !important;
}

/* Ensure non-color checkboxes (product type, option type) remain normal */
.select-options input[type="checkbox"]:not(.color-checkbox) {
    width: 16px !important;
    height: 16px !important;
    margin-right: 8px !important;
    flex-shrink: 0 !important;
    accent-color: var(--primary-color) !important;
}

/* Improve spacing for color filter specifically */
#color-filter .select-options {
    min-width: 220px !important;
    max-width: 350px !important;
}

#color-filter .select-options label {
    padding: 8px 12px !important;
}

/* Make sure regular filter labels don't get the color styling */
#product-type-filter .select-options label,
#option-type-filter .select-options label {
    display: flex !important;
    align-items: center !important;
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#product-type-filter .select-options label:hover,
#option-type-filter .select-options label:hover {
    background: #f0f0f0 !important;
}

/* Responsive adjustments for color checkboxes */
@media (max-width: 768px) {
    .color-checkbox {
        width: 18px !important;
        height: 18px !important;
    }
    
    .color-checkbox:checked::after {
        font-size: 12px !important;
    }
    
    .color-option-label {
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
        gap: 8px !important;
    }
    
    #color-filter .select-options {
        min-width: 200px !important;
        max-width: 300px !important;
    }
}

@media (max-width: 480px) {
    .color-checkbox {
        width: 16px !important;
        height: 16px !important;
    }
    
    .color-checkbox:checked::after {
        font-size: 11px !important;
    }
    
    .color-option-label {
        gap: 6px !important;
    }
}

/* ========================================
   GALLERY GRID
======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    background-color: var(--card-background);
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInItem 0.5s ease-out forwards;
    opacity: 0;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.gallery-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-image-container::after {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

/* Gallery Imtem info is for testing purposes*/
.gallery-item-info {
    display: none;
}

.gallery-item-info p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: #555;
}

/* Gallery Image Dots */
.gallery-image-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}

.gallery-dot {
    height: 10px;
    width: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.gallery-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

.gallery-dot:hover {
    background-color: #666;
    transform: scale(1.15);
}

/* Better touch targets on mobile */
@media (max-width: 768px) {
    .gallery-dot {
        height: 12px;
        width: 12px;
        padding: 2px;
    }
}

/* Gallery item animation delays */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }


/* Additional CSS for Gallery Features */
/* Add this to your existing styles.css file */

/* ========================================
   MULTIPLE IMAGES INDICATOR
======================================== */
.multiple-images-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  z-index: 10;
}

.multiple-images-indicator i {
  font-size: 0.8rem;
}

.gallery-item:hover .multiple-images-indicator {
  background: rgba(44, 110, 127, 0.9);
  transform: scale(1.05);
}

/* ========================================
   SIZE SELECTION MODAL
======================================== */
.size-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.size-selection-content {
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease-out;
}

.size-selection-header {
  background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.size-selection-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.size-selection-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.size-selection-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.size-selection-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.size-selection-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.size-options-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.size-preview-panel h4 {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  color: var(--text-color);
  font-weight: 600;
  text-align: center;
}

.size-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-field-label {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.size-field-select {
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.size-field-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 110, 127, 0.1);
}

.size-field-select:hover {
  border-color: var(--primary-color);
}

#size-preview-container {
  width: 100%;
  min-height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.size-selection-actions {
  padding: 20px 25px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
}

.size-selection-actions .secondary-btn,
.size-selection-actions .primary-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 120px;
}

.size-selection-actions .secondary-btn {
  background-color: #f5f5f5;
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

.size-selection-actions .secondary-btn:hover {
  background-color: #e9ecef;
  border-color: var(--primary-color);
}

.size-selection-actions .primary-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
  color: white;
  border: 2px solid transparent;
}

.size-selection-actions .primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 110, 127, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN FOR SIZE MODAL
======================================== */
@media (max-width: 768px) {
  .size-selection-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .size-preview-panel {
    order: -1; /* Show preview first on mobile */
  }
  
  #size-preview-container {
    min-height: 200px;
  }
  
  .size-selection-actions {
    flex-direction: column;
  }
  
  .size-selection-actions .secondary-btn,
  .size-selection-actions .primary-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .size-selection-modal {
    padding: 10px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .size-selection-content {
    width: 100%;
    max-height: none;
    margin: 10px 0;
  }

  .size-selection-header {
    padding: 15px 20px;
  }

  .size-selection-header h3 {
    font-size: 1.2rem;
  }

  .size-selection-body {
    padding: 15px;
  }

  #size-preview-container {
    min-height: 120px;
  }

  .size-selection-actions {
    padding: 15px;
    gap: 10px;
  }

  .size-selection-actions .secondary-btn,
  .size-selection-actions .primary-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-width: 100px;
  }
}

/* ========================================
   MODAL PREVIEW LAYER STYLES
======================================== */
.modal-preview-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   ENHANCED GALLERY ITEM HOVER EFFECTS
======================================== */
.gallery-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.gallery-image-container {
  overflow: hidden;
}

.gallery-image {
  transition: transform 0.3s ease;
}

/* ========================================
   IMPROVED MODAL NAVIGATION
======================================== */
.modal-image-container {
  position: relative;
  text-align: center;
}

#modal-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  padding: 10px;
}

.image-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.image-dots .dot:hover {
  background-color: #888;
  transform: scale(1.2);
}

.image-dots .dot.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(44, 110, 127, 0.3);
}

/* ========================================
   ERROR HANDLING & NOTIFICATIONS
======================================== */
.error-container {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.error {
    background-color: #ffebee;
    border: 1px solid var(--error-color);
    color: #d32f2f;
}

.warning {
    background-color: #fff8e1;
    border: 1px solid var(--warning-color);
    color: #ff8f00;
}

.error-icon {
    font-size: 24px;
    margin-right: 15px;
}

.error-message {
    flex-grow: 1;
}

.retry-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.retry-button:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

/* No results message (when filters applied) */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: #666;
}

.no-results a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.no-results a:hover {
    color: var(--hover-color);
}

/* No products container (when gallery is empty) */
.no-products-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.no-products-icon {
    font-size: 5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-products-container h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 15px 0;
}

.no-products-container p {
    font-size: 1.1rem;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.no-products-container p:last-child {
    font-weight: 500;
    color: var(--primary-color);
}

/* Responsive adjustments for no products container */
@media (max-width: 768px) {
    .no-products-container {
        padding: 40px 20px;
    }

    .no-products-icon {
        font-size: 4rem;
    }

    .no-products-container h2 {
        font-size: 1.6rem;
    }

    .no-products-container p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .no-products-container {
        padding: 30px 15px;
    }

    .no-products-icon {
        font-size: 3rem;
    }

    .no-products-container h2 {
        font-size: 1.4rem;
    }

    .no-products-container p {
        font-size: 0.9rem;
    }
}

.gallery-warning {
    color: #ff8f00;
    padding: 10px;
    margin: 10px 0;
}

#global-error-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.error-notification {
    margin-bottom: 10px;
}

.close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-color);
}

#filter-warning {
    margin-bottom: 15px;
}

/* ========================================
   MODALS - IMAGE GALLERY MODAL
======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    overflow: auto;
    animation: modalFade 0.3s ease-in-out;
}

.modal-content {
    margin: 10% auto;
    padding: 30px;
    background-color: var(--card-background);
    width: 80%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    z-index: 1010;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

#modal-image {
    width: 100%;
    max-width: calc(100% - 20px);
    max-height: 60vh;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s;
    margin: 0;
    display: block;
    touch-action: pan-y pinch-zoom;
    user-select: none;
}

#modal-image.zoomed {
    cursor: zoom-out;
    transform-origin: center;
}

.image-dots {
    text-align: center;
    margin-top: 10px;
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin: 0 5px;
    cursor: pointer;
}

.dot.active {
    background-color: var(--primary-color);
}

.modal-buttons {
    text-align: center;
    margin-top: 15px;
}

.modal-buttons button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#open-custom-builder,
#add-to-cart,
#size-selection-confirm {
    background-color: var(--primary-color);
    color: white;
}

#open-custom-builder:hover,
#add-to-cart:not(:disabled):hover,
#size-selection-confirm:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
}

#add-to-cart:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

#size-selection-cancel {
    background-color: #e63946;
    color: white;
}

#size-selection-cancel:hover {
    background-color: #c1121f;
    transform: translateY(-2px);
}

/* Size Selection Modal Specific */
#size-selection-modal h2 {
    margin-top: 0;
    text-align: center;
    font-size: 1.8rem;
}

.size-selection-field {
    margin: 10px 0;
}

.size-selection-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.size-selection-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background: #f9f9f9;
}

/* ========================================
   MODALS - CART SUCCESS MODAL
======================================== */
.cart-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.cart-success-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-out;
}

.cart-success-header {
    background-color: var(--success-color);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.cart-success-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.cart-success-header i {
    margin-right: 10px;
}

.cart-success-body {
    padding: 20px;
}

.item-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.item-image {
    flex-shrink: 0;
}

#success-preview-images {
    position: relative;
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#success-preview-images:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-preview-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    margin: 0 0 10px 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

#success-item-config {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.item-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.quantity-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls label {
    font-weight: 600;
    color: var(--text-color);
}

.quantity-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    background-color: #f5f5f5;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

#item-quantity {
    border: none;
    text-align: center;
    width: 60px;
    padding: 8px;
    font-size: 1rem;
    outline: none;
}

.cart-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.cart-total {
    font-size: 1.2rem;
    color: var(--text-color);
}

.cart-item-count {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.cart-success-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #eee;
}

.secondary-btn,
.primary-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.secondary-btn {
    background-color: #f5f5f5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background-color: #e0e0e0;
}

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

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

/* ========================================
   MODALS - DETAILED PREVIEW MODAL
======================================== */
.detailed-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detailed-modal .modal-content {
    margin: 0;
    padding: 0;
    width: 60%;
    max-width: 600%;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    background-color: var(--card-background);
}

.product-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.modal-views {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.view-container {
    flex: 1;
    text-align: center;
}

.view-container h4 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.modal-preview,
.exterior-preview,
.interior-preview {
    position: relative;
    width: 100%;
    height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.preview-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.9rem;
}

/* ========================================
   JUMP TO TOP BUTTON
======================================== */
.jump-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(44, 110, 127, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.jump-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.jump-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(44, 110, 127, 0.4);
    background: linear-gradient(135deg, var(--hover-color), var(--primary-color));
}

.jump-to-top:active {
    transform: translateY(-1px) scale(1.05);
}

/* ========================================
   ANIMATIONS & KEYFRAMES
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modalFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

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

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

/* ========================================
   UTILITY CLASSES
======================================== */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Focus states for accessibility */
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   RESPONSIVE DESIGN - UPDATED FOR GRID FILTERS
======================================== */

/* Large Tablets & Small Desktops */
@media (max-width: 1024px) {
    header {
        padding: 15px;
    }

    .logo {
        font-size: 1.4rem;
        padding-right: 50px;
    }

    /* Navigation responsive styles inherited from shared.css */

    .hero {
        padding: 40px 20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .gallery-image-container {
        height: 180px;
    }

    .filters {
        padding: 15px 15px 5px 15px;
    }

    .filter-group {
        min-width: 160px;
    }

    .filter-group-with-toggle {
        min-width: 260px; 
    }

    .product-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-views {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-preview,
    .exterior-preview,
    .interior-preview {
        height: 200px;
    }
    
    .view-container h4 {
        font-size: 1rem;
    }
}

/* Better tablet breakpoint */
@media (max-width: 900px) {
    .filter-group {
        min-width: 140px;
    }

    .filter-group-with-toggle {
        min-width: 240px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .gallery-container {
        margin-top: -20px;
        padding: 20px 15px;
    }

    .jump-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .filters {
        padding: 12px 12px 5px 12px;
    }

    .filter-group {
        min-width: 120px;
    }

    .filter-group-with-toggle {
        min-width: 220px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 600px) {
    .filters {
        padding: 12px 12px 5px 12px;
    }

    .filter-group {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .filter-group-with-toggle {
        min-width: 100%;
        flex: 1 1 100%;
        flex-direction: column;
        gap: 10px;
    }

    .filter-group-with-toggle .filter-group {
        width: 100%;
    }

    .color-specific-toggle {
        width: 100%;
        justify-content: center;
    }

    .toggle-label {
        width: 100%;
        justify-content: center;
    }

    .filters-bottom-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .sort-toggle-btn {
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .gallery-item img {
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .nav-arrow {
        font-size: 30px;
        width: 40px;
        height: 40px;
        line-height: 40px;
    }

    .nav-arrow.left { left: 10px; }
    .nav-arrow.right { right: 10px; }

    #modal-image {
        max-height: 50vh;
    }

    .cart-success-modal {
        padding: 10px;
    }

    .cart-success-content {
        width: 95%;
        max-height: 95vh;
    }

    .item-summary {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    #success-preview-images {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .cart-success-actions {
        flex-direction: column;
        padding: 15px;
    }

    .secondary-btn,
    .primary-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .hero {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .hero p {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .jump-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .gallery-container {
        margin-top: -15px;
        padding: 15px 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-image-container {
        height: 150px;
    }

    .gallery-item img {
        height: 150px;
    }

    .filters {
        padding: 10px 10px 5px 10px;
    }

    .filter-group,
    .filter-group-with-toggle {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .filter-group-with-toggle {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group-with-toggle .filter-group {
        width: 100%;
    }

    .color-specific-toggle {
        width: 100%;
        justify-content: center;
    }

    .toggle-label {
        width: 100%;
        justify-content: center;
    }

    .modal-views {
        gap: 10px;
    }

    .modal-preview,
    .exterior-preview,
    .interior-preview {
        height: 150px;
    }

    .view-container h4 {
        font-size: 0.9rem;
    }

    .nav-arrow {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
    }

    .nav-arrow.left { left: 5px; }
    .nav-arrow.right { right: 5px; }

    .image-dots {
        padding: 5px;
    }

    .dot {
        height: 8px;
        width: 8px;
        margin: 0 3px;
    }
}