/* ==========================================================================
   CASA GAUCHO - HIGH-END HERITAGE DESIGN SYSTEM
   Based on DESIGN.md & frontend-design skill (Elevated Minimalism, 0px Sharp Geometry)
   ========================================================================== */

:root {
  --primary: #000000;
  --on-primary: #ffffff;
  --secondary: #FFC107;
  --secondary-hover: #e0a800;
  --surface: #ffffff;
  --surface-container-low: #f7f7f8;
  --surface-container: #eeeeee;
  --surface-container-high: #e2e2e2;
  --on-surface: #1a1c1c;
  --on-surface-muted: #6b7280;
  --background: #f9f9f9;
  --on-background: #1a1c1c;
  --outline: #000000;
  --outline-subtle: #e5e5e5;
  --outline-variant: #cfc4c5;
  
  --radius: 0px;
  
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 40px;
  --spacing-2xl: 80px;
  --spacing-gutter: 28px;
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-caps: 'Hanken Grotesk', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Strict 0px geometric discipline */
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--on-background);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
.font-headline {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

.font-label-caps {
  font-family: var(--font-caps);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ==========================================================================
   BUTTONS & ACCENTS
   ========================================================================== */
.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
  padding: 14px 28px;
  font-family: var(--font-caps);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--primary);
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #1a1a1a;
  border-bottom-color: var(--secondary);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--primary);
  padding: 14px 28px;
  font-family: var(--font-caps);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

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

.btn-whatsapp {
  background-color: #25D366;
  color: #ffffff;
  border: 1px solid #20bd5a;
  border-bottom: 3px solid #128C7E;
}

.btn-whatsapp:hover {
  background-color: #20bd5a;
  border-bottom-color: #0d6e63;
}

.btn-whatsapp.disabled,
.btn-whatsapp:disabled {
  background-color: #9ca3af !important;
  border-color: #6b7280 !important;
  border-bottom-color: #4b5563 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  opacity: 0.65;
}

/* ==========================================================================
   CATALOG LAYOUT
   ========================================================================== */
.catalog-body-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Sidebar & Filters */
.filter-sidebar {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--outline-subtle);
  padding: var(--spacing-lg);
}

.filter-sidebar-inner {
  display: flex;
  flex-direction: column;
}

/* Filter Chips (Tallas) */
.chip {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--outline-subtle);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip:hover {
  border-color: var(--primary);
  background-color: #f7f7f7;
}

.chip.active {
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--secondary);
}

/* Chips y Opciones Deshabilitadas / Sin Stock */
.chip:disabled,
.chip.disabled,
.chip[disabled] {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
  background-color: #f3f4f6 !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  text-decoration: line-through;
  box-shadow: none !important;
}

.chip-soldout-label {
  font-size: 8px;
  background: #dc2626;
  color: #ffffff;
  padding: 1px 4px;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
  display: inline-block;
  line-height: 1.2;
}

/* Color Filter Rows */
.color-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--outline-subtle);
  background-color: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.color-item:hover {
  border-color: var(--primary);
  background-color: #fafafa;
}

.color-item.active {
  border-color: var(--primary);
  background-color: #1a1a1a;
  color: #ffffff;
}

.color-item.active .color-item-name {
  color: #ffffff;
}

.color-item.active .color-check {
  display: inline-block;
}

.color-swatch-box {
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.color-item-name {
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface);
  flex-grow: 1;
}

.color-check {
  display: none;
  font-size: 14px;
  color: var(--secondary);
}

/* Active Filter Badges */
.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 4px 10px;
  font-family: var(--font-caps);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-badge button {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  line-height: 1;
}

.filter-badge button:hover {
  color: #ffffff;
}

/* ==========================================================================
   CATALOG PRODUCT CARDS
   ========================================================================== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--outline-subtle);
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.product-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--secondary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover::after {
  opacity: 1;
}

/* Image Container */
.product-image-container {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background-color: #f2f2f3;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

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

/* Floating Badges */
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-caps);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  z-index: 2;
  border-left: 2px solid var(--secondary);
}

/* Card Content */
.product-info {
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
}

.product-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary);
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 52px;
}

.product-card:hover .product-name {
  color: #785900;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 4px;
  border-top: 1px dashed var(--outline-subtle);
}

.product-price {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.product-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.product-swatches {
  display: flex;
  gap: 4px;
  align-items: center;
}

.swatch-dot {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0,0,0,0.25);
  display: inline-block;
}

.product-sizes-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.size-mini-chip {
  font-family: var(--font-caps);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  background-color: #f0f0f0;
  color: #333333;
  border: 1px solid #dcdcdc;
}

.size-mini-chip.disabled {
  opacity: 0.4;
  text-decoration: line-through;
  background-color: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}

.swatch-dot.disabled {
  opacity: 0.35;
  filter: grayscale(80%);
}

.card-badge.badge-sold-out {
  background-color: #dc2626;
  color: #ffffff;
  border-left: 2px solid #991b1b;
}

.card-action-bar {
  margin-top: 10px;
  padding-top: 8px;
}

.btn-card-consult {
  width: 100%;
  padding: 10px 0;
  background-color: #000000;
  color: #ffffff;
  font-family: var(--font-caps);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-card-consult:hover {
  background-color: var(--secondary);
  color: #000000;
}

/* ==========================================================================
   SKELETON LOADING & EMPTY STATES
   ========================================================================== */
.skeleton-card {
  background: #ffffff;
  border: 1px solid var(--outline-subtle);
  display: flex;
  flex-direction: column;
}

.skeleton-img {
  aspect-ratio: 3/4;
  background: linear-gradient(90deg, #eeeeee 25%, #f7f7f7 50%, #eeeeee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  height: 16px;
  background: linear-gradient(90deg, #eeeeee 25%, #f7f7f7 50%, #eeeeee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.empty-state-box {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px dashed var(--outline-subtle);
  padding: var(--spacing-2xl) var(--spacing-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MODAL & QUICK VIEW
   ========================================================================== */
#product-modal.show {
  opacity: 1;
  pointer-events: auto;
}

#product-modal.show .modal-card {
  transform: scale(1);
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE DRAWER
   ========================================================================== */
@media (max-width: 1024px) {
  .catalog-body-grid {
    grid-template-columns: 220px 1fr;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .catalog-body-grid {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    border: none;
  }

  .filter-sidebar.mobile-open {
    transform: translateX(0);
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

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

  .product-name {
    font-size: 16px;
    min-height: 42px;
  }

  .product-price {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ==========================================================================
   CAROUSEL & ANIMATIONS
   ========================================================================== */
#mobile-menu {
  clip-path: circle(0% at top right);
  transition: clip-path 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.open {
  clip-path: circle(150% at top right);
}

@keyframes slideInLeft {
  0% { transform: translateX(-100vw); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
  0% { transform: translateX(100vw); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.animate-slide-in-left {
  animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-slide-in-right {
  animation: slideInRight 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   BRAND LOGO & TOPBAR IDENTITY
   ========================================================================== */
.brand-identity {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.brand-identity:hover {
  opacity: 0.95;
}

.brand-emblem-img {
  height: 54px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-text-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-identity:hover .brand-emblem-img {
  transform: scale(1.05);
}

.brand-identity:hover .brand-text-img {
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .brand-identity {
    gap: 8px;
  }
  .brand-emblem-img {
    height: 40px;
  }
  .brand-text-img {
    height: 30px;
  }
}

@media (max-width: 400px) {
  .brand-identity {
    gap: 6px;
  }
  .brand-emblem-img {
    height: 34px;
  }
  .brand-text-img {
    height: 26px;
  }
}

/* ==========================================================================
   DESKTOP & TABLET TOPNAV ANIMATED UNDERLINE (>= 768px ONLY)
   ========================================================================== */
@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }

  .desktop-nav .nav-link {
    position: relative;
    font-family: var(--font-caps, 'Hanken Grotesk', sans-serif);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-primary, #ffffff);
    text-decoration: none;
    padding-bottom: 6px;
    transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
  }

  .desktop-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2.5px;
    background-color: var(--secondary, #FFC107);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
  }

  .desktop-nav .nav-link:hover {
    color: var(--secondary, #FFC107);
  }

  .desktop-nav .nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
  }

  .desktop-nav .nav-link.active {
    color: var(--secondary, #FFC107);
  }

  .desktop-nav .nav-link.active::after {
    transform: scaleX(1);
    background-color: var(--secondary, #FFC107);
  }
}

/* ==========================================================================
   CATALOG PAGINATION
   ========================================================================== */
.catalog-pagination-container {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--outline-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background-color: var(--surface);
  color: var(--primary);
  border: 1px solid var(--outline-subtle);
  font-family: var(--font-caps);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  background-color: var(--surface-container-low);
  color: var(--primary);
}

.pagination-btn.active {
  background-color: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  cursor: default;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--outline-subtle);
  background-color: var(--surface-container-low);
  color: var(--on-surface-muted);
}

.pagination-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 0 14px;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 40px;
  color: var(--on-surface-muted);
  font-weight: 700;
  user-select: none;
}

.pagination-info {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
}







