:root {
  --color-primary: #1a1a1a;
  --color-accent: #40C9C0;
  --color-bg: #f8f9fa;
  --color-text: #333;
  --color-secondary: #666;
  --color-border: #eaeaea;
  --font-main: 'Outfit', sans-serif;
  --radius: 4px;
  /* Unificado para todo el proyecto */
  --radius-sm: var(--radius);
  /* Used generally, but cards might be square */
  --shadow-outer: -10px 5px 15px rgba(0, 0, 0, 0.4);
  --shadow-inner: inset 0 0 15px rgba(0, 0, 0, 0.2);
  --frame-border-width: 6px;
  --header-height: 72px;
}

body.scrolled {
  --header-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* Header */
app-header {
  display: block;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
}

body.scrolled .header {
  padding: 1rem 0 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

#mobile-menu-btn {
  display: none;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--color-accent);
}

.logo {
  height: 40px;
  cursor: pointer;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform 0.2s;
}

.cart-icon:hover {
  transform: scale(1.05);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-accent);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  transform: translate(25%, -25%);
}

/* Hero Redesign */
.hero {
  position: relative;
  background-color: #F9F8F5;
  /* Classy cream background */
  overflow: hidden;
  padding: 4rem 0;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-watermark {
  position: absolute;
  right: -5%;
  bottom: 0%;
  font-size: 15vw;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.03);
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  font-family: var(--font-main);
  letter-spacing: -0.05em;
}

.hero-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-left {
  max-width: 600px;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  color: #333;
  margin-bottom: 1.5rem;
  margin-left: 0 !important;
  padding-left: 0 !important;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-secondary);
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.hero-cta {
  background: #4a4a4a;
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 4rem;
  border-radius: var(--radius);
}

.hero-cta:hover {
  background: #333;
}

.hero-stats {
  display: flex;
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 600;
  color: #333;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-frame {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 3/4;
  background: white;
  border: 15px solid #1a1a1a;
  /* Thick frame simulation */
  box-shadow: 0 1px 20px 1px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

/* Inner shadow for realism */
.hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}

.carousel {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel img.active {
  opacity: 1;
}

/* Gallery */
.gallery-header {
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  background-color: #F9F8F5;
  padding: 0rem 0 2rem 0;
  width: 100%;
  border-bottom: 1px solid #eaeaea;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, box-shadow 0.3s ease;
}

body.scrolled .gallery-header {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
  padding-bottom: 0 !important;
}

body.scrolled .gallery-header .section-title {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  transform: translateY(-20px);
  pointer-events: none;
}

body.scrolled .controls-container {
  padding: 2rem 2rem 2rem 2rem !important;
}

.gallery-header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2rem;
}

.gallery-section {
  padding: 3.5rem 2rem 4rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  font-weight: 700;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease, transform 0.3s ease;
  max-height: 100px;
  opacity: 1;
  overflow: hidden;
}

.controls-container {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-label {
  font-weight: 600;
  color: var(--color-secondary);
  font-size: 0.9rem;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.5rem;
}

/* Hide scrollbar for a cleaner look while keeping functionality */
.filter-buttons::-webkit-scrollbar {
  display: none;
}

.filter-buttons {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-btn,
.frame-filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--color-border);
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.9rem;
  background: white;
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.frame-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
}

.filter-btn:hover,
.frame-filter-btn:hover {
  border-color: #999;
}

.filter-btn.active {
  background: var(--color-text);
  color: white;
  border-color: var(--color-text);
}

.frame-filter-btn.active {
  border-color: var(--color-text);
  background: #f9f9f9;
  font-weight: 600;
}

#btn-fav-filter.active {
  background: #ff4757 !important;
  color: white !important;
  border-color: #ff4757 !important;
}

/* --- HERO CAROUSEL --- */
.hero-section {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  background: #f0f0f0;
}

#carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

#carousel img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

#carousel img.active {
  opacity: 1;
}

/* --- GALLERY --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 0;
}

.grid-item {
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}

.grid-item:hover {
  transform: translateY(-5px);
}

.frame-wrapper {
  background: #fff;
  transition: all 0.3s ease;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 0;
}

.image-inner-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 140%;
  /* aspect ratio */
  overflow: hidden;
}

.image-inner-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inner-shadow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.product-info {
  padding: 1rem 0;
  text-align: center;
}

.product-info h3 {
  margin: 0 0 0rem;
  font-size: 1rem;
  font-weight: 600;
}

.product-info .price {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
}

.fav-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  color: #ccc;
  transition: color 0.2s;
}

.fav-btn:hover {
  color: #ff4757;
}

.fav-btn.active {
  color: #ff4757;
}

.fav-btn svg {
  width: 18px;
  height: 18px;
}

/* Load More */
.load-more-container {
  text-align: center;
  margin: 3rem 0;
}

.load-more-text {
  display: block;
  margin-bottom: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.load-more-btn {
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 12px 30px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 0 !important;
}

.load-more-btn:hover {
  background: #333;
}

/* --- MODAL --- */
body.no-scroll {
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
  position: relative !important;
}
html.no-scroll {
  overflow: hidden !important;
  height: 100% !important;
}

.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.product-modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  border-radius: 8px;
  position: relative;
  display: flex;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  background: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.modal-body {
  display: flex;
  width: 100%;
  height: 100%;
}

.modal-image-container {
  flex: 1;
  background: #f5f5f5;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-frame-wrapper {
  position: relative;
  background: white;
  transition: all 0.3s;
}

#modal-image {
  max-height: 60vh;
  max-width: 100%;
  display: block;
}

#modal-inner-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.modal-info {
  width: 400px;
  padding: 2rem;
  overflow-y: auto;
  background: white;
}

.modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.modal-price {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: #1a1a1a;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section h4 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #666;
}

.format-options,
.size-options,
.frame-color-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.format-btn,
.size-btn {
  border: 1px solid #ddd;
  background: white;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.format-btn:hover,
.size-btn:hover {
  border-color: #999;
}

.format-btn.active,
.size-btn.active {
  border-color: #1a1a1a;
  border-width: 2px;
  padding: 9px 19px;
}

.frame-color-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 2px;
}

.frame-color-btn.active {
  border-color: #1a1a1a;
}

.frame-color-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid #ddd;
}

.add-to-cart-btn {
  width: 100%;
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s;
}

.add-to-cart-btn:hover {
  background: #333;
}

/* Responsive Modal */

/* --- CART DRAWER --- */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cart-content {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  height: 100dvh;
  background: white;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.3s;
}

.cart-overlay.active .cart-content {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.close-cart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overscroll-behavior: contain;
}

.cart-item {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 1.5rem;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.cart-item-desc {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

.cart-item-price {
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #ff4757;
  cursor: pointer;
  padding: 0.2rem;
}

.cart-footer {
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eee;
  background: #fafafa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkout-btn {
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  width: 100%;
}

.continue-shopping-btn {
  background: white;
  color: #1a1a1a;
  border: 1px solid #ddd;
  padding: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  width: 100%;
}

/* Base styles for the new dots */
.frame-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
}

.frame-dot.none {
  display: inline-block !important;
  border: 1.5px dashed #777 !important;
  background: transparent !important;
}

.frame-dot.black {
  background: #1a1a1a !important;
}

.frame-dot.white {
  background: #ffffff !important;
  border: 1px solid #ddd !important;
}

.frame-dot.oak {
  background: #d2b48c !important;
}

/* =========================================
   COMPREHENSIVE MOBILE OVERRIDES (v2)
   ========================================= */

/* ======== HOTFIXES ======== */
/* Ensure Sticky Works */
html,
body {
  overflow-x: clip !important;
}



/* Ensure colored dots are visible globally */
.frame-filter-btn {
  display: flex !important;
  align-items: center !important;
}

.frame-dot {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  margin-right: 8px !important;
}

.frame-dot.black {
  background: #1a1a1a !important;
  border: 1px solid #ddd !important;
}

.frame-dot.white {
  background: #ffffff !important;
  border: 1px solid #ddd !important;
}

.frame-dot.oak {
  background: #d2b48c !important;
}

/* ======== UI/UX REFINEMENTS ======== */

/* 1. Modal Close Button Polish */
.modal-close {
  top: 20px !important;
  right: 20px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: white !important;
  border: 1px solid #eee !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  color: #333 !important;
}

.modal-close:hover {
  transform: scale(1.08) !important;
  color: #000 !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
}

/* 2. Load More Button Polish */
.load-more-btn {
  border-radius: 4px !important;
  padding: 14px 45px !important;
  letter-spacing: 1.5px !important;
  font-size: 0.85rem !important;
  text-transform: uppercase !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  border: 1px solid #1a1a1a !important;
  margin-bottom: 1rem;
}

.load-more-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15) !important;
  background: #333 !important;
}

/* 3. Filters & Modal Buttons Polish */
.filter-btn,
.frame-filter-btn,
.format-btn,
.size-btn {
  border-radius: 30px !important;
  border: 1px solid #e0e0e0 !important;
  transition: all 0.2s ease !important;
  background: white !important;
  color: #555 !important;
}

.filter-btn:hover,
.frame-filter-btn:hover,
.format-btn:hover,
.size-btn:hover {
  background: #f8f8f8 !important;
  border-color: #ccc !important;
  color: #1a1a1a !important;
}

.filter-btn.active,
.frame-filter-btn.active,
.format-btn.active,
.size-btn.active {
  background: #1a1a1a !important;
  color: white !important;
  border-color: #1a1a1a !important;
  font-weight: 500 !important;
}

/* Fix inner dots for active states in filters */
.frame-filter-btn.active .frame-text {
  color: white !important;
}

/* Gap for frame dots and text */
.frame-text {
  margin-left: 4px !important;
}

/* Filter Groups Spacing */
.filter-group {
  gap: 1.2rem !important;
}

.filter-label {
  font-weight: 600 !important;
  color: #333 !important;
}

/* Modal Add to Cart Button */
#add-to-cart-btn {
  border-radius: 30px !important;
  padding: 16px !important;
  font-size: 1rem !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  margin-top: 1rem !important;
}

#add-to-cart-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Modal Softness */
.modal-content {
  border-radius: 0px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
}

.modal-image-container {
  border-top-left-radius: 16px !important;
  border-bottom-left-radius: 16px !important;
}

/* ======== MODAL REDESIGN V3 ======== */
.modal-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 1.5px;
  margin-bottom: 5px;
}

.modal-title {
  font-size: 1.8rem !important;
  font-weight: 900 !important;
  margin-bottom: 5px !important;
  color: #333;
}

.modal-price {
  font-size: 1.2rem !important;
  color: #40cbb5 !important;
  /* Teal */
  font-weight: 600 !important;
  margin-bottom: 2rem !important;
}

/* Style Grid */
.style-options-grid {
  padding-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.style-btn {
  display: flex;
  align-items: center;
  padding: 10px;
  background: white !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px !important;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.style-btn:hover {
  border-color: #999 !important;
}

.style-btn.active {
  border-color: #1a1a1a !important;
  background: #fafafa !important;
}

.style-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-dot.none svg {
  width: 100%;
  height: 100%;
}

.style-dot.black {
  background: #1a1a1a;
  border: 1px solid #ddd;
}

.style-dot.white {
  background: #ffffff;
  border: 1px solid #ddd;
}

.style-dot.oak {
  background: #d2b48c;
}

.style-text {
  font-size: 0.85rem;
  line-height: 1.2;
  color: #333;
  flex-grow: 1;
}

.check-icon {
  width: 16px;
  height: 16px;
  opacity: 0;
  color: #1a1a1a;
}

.style-btn.active .check-icon {
  opacity: 1;
}

/* Size Grid */
.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.size-btn {
  padding: 12px;
  background: white !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 4px !important;
  font-size: 0.85rem !important;
  color: #333 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.size-btn:hover {
  border-color: #999 !important;
}

.size-btn.active {
  background: #4a4a4a !important;
  color: white !important;
  border-color: #4a4a4a !important;
  font-weight: 500 !important;
}

/* Teal Add To Cart */
#add-to-cart-btn {
  background: #40cbb5 !important;
  color: white !important;
  border-radius: 4px !important;
  padding: 16px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  width: 100% !important;
  border: none !important;
  margin-top: 1.5rem !important;
  box-shadow: none !important;
}

#add-to-cart-btn:hover {
  background: #36b09d !important;
  transform: none !important;
  box-shadow: 0 4px 10px rgba(64, 203, 181, 0.3) !important;
}

/* Ensure all UI elements inherit the main font Outfit */
button,
input,
select,
textarea,
.style-btn,
.size-btn,
#add-to-cart-btn {
  font-family: 'Outfit', sans-serif !important;
}

/* ======== DYNAMIC ASPECT RATIO GALLERY ======== */
.gallery-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 2.5rem 1.5rem !important;
  /* larger vertical gap, smaller horizontal */
}

.grid-item {
  width: auto !important;
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

.frame-wrapper {
  display: inline-block !important;
  /* Shrink to fit image width */
  height: 360px !important;
  /* Fixed height for all frames in desktop */
  width: auto !important;
}

.image-inner-wrapper {
  padding-bottom: 0 !important;
  /* Remove aspect ratio hack */
  height: 100% !important;
  width: auto !important;
}

.image-inner-wrapper img {
  position: relative !important;
  height: 100% !important;
  width: auto !important;
  max-width: 100vw !important;
  /* Prevent overflowing screen */
  object-fit: cover !important;
  display: block !important;
}

.product-info {
  margin-top: 2rem !important;
  width: 100% !important;
}

/* Mobile Adjustments */

/* ======== STANDARD GRID LAYOUT (ALIGNED TOPS, VARIABLE HEIGHTS) ======== */
.gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 1.5rem !important;
  align-items: start !important;
  /* This ensures the top of each row is a straight horizontal line */
}

.grid-item {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  transition: transform 0.2s ease !important;
}

.frame-wrapper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  /* Height adapts to the image naturally */
  display: block !important;
  box-shadow: -2.5px 2.5px 10px rgba(0, 0, 0, 0.25) !important;
  border-radius: 2px;
}

.image-inner-wrapper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  padding-bottom: 0 !important;
  /* No fixed aspect ratio */
  display: block !important;
}

.image-inner-wrapper img {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  /* Naturally adapts to width maintaining proportion */
  max-height: 450px !important;
  /* Tope mï¿½ximo */
  object-fit: cover !important;
  /* Fill without white spaces if it hits the max-height */
  object-position: center !important;
  display: block !important;
}

.product-info {
  margin-top: 0.25rem !important;
  width: 100% !important;
}





/* ==========================================================================
   ====== PREMIUM UPGRADES (Animations, Glassmorphism) ======
   ========================================================================== */

/* 1. SCROLL REVEAL ANIMATIONS */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 2. GLASSMORPHISM CART */
.cart-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.cart-header,
.cart-footer {
  background: transparent !important;
  border-color: var(--color-border) !important;
}

/* 3. TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.toast {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   ====== ESTILOS RESPONSIVE (Optimizados y centralizados) ======
   ========================================================================== */

/* FIX NEGATIVE X BOUNDARY BUG (Global Safeguards) */
html,
body {
  overflow-x: clip !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
}

.hero {
  overflow: hidden !important;
  /* Prevent watermark from pushing negative X */
  width: 100% !important;
  max-width: 100vw !important;
}

.header {
  width: 100% !important;
  max-width: 100vw !important;
}

.gallery-section {
  width: 100% !important;
  max-width: 1600px !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
}

/* ======== TABLET STYLES (Max-width: 1279px) ======== */
@media (max-width: 1279px) {
  :root {
    --frame-border-width: 6px;
  }

  /* Navigation & Menu */
  #mobile-menu-btn {
    display: flex !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
  }

  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    box-shadow: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    z-index: 150;
    pointer-events: none;
  }

  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
  }

  .main-nav a {
    font-size: 2.2rem;
    font-weight: 500;
    padding: 1.5rem 0;
    border-bottom: none;
    color: var(--color-text);
    transition: color 0.2s ease;
  }

  .main-nav a:hover {
    color: #ff4757;
  }

  /* Filters & Controls */
  .controls-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    padding-bottom: 0rem !important;
  }

  .filter-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .filter-buttons {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  .filter-buttons::-webkit-scrollbar {
    display: none !important;
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
    column-count: unset !important;
    column-gap: 1rem !important;
  }

  /* Hero Section */
  .hero-section {
    height: 40vh;
  }

  .hero-frame {
    border-width: 10px !important;
  }

  /* Universal Responsive Modal */
  .product-modal .modal-content {
    flex-direction: column;
    height: 90vh !important;
    max-height: 90vh !important;
    overflow: hidden !important;
  }

  .product-modal .modal-body {
    flex-direction: column !important;
    height: 100% !important;
    overflow-y: auto !important;
    display: block !important;
    overscroll-behavior: contain !important;
  }

  .product-modal .modal-image-container {
    display: flex !important;
    flex: none !important;
    height: auto !important;
    max-height: none !important;
    padding: 2rem !important;
    background: #f5f5f5 !important;
  }

  .product-modal #modal-image {
    max-height: 40vh !important;
    object-fit: contain !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .product-modal .modal-info {
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    overflow-y: visible !important;
    padding: 1.5rem !important;
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ======== MOBILE STYLES (Max-width: 799px) ======== */
@media (max-width: 799px) {
  :root {
    --frame-border-width: 4px;
  }

  /* Hide massive watermark to avoid layout shifts */
  .hero-watermark {
    display: none !important;
  }

  /* Global Layout Guards */
  body,
  html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
  }

  .hero-container {
    overflow-x: hidden;
  }

  .container {
    padding: 0 1rem !important;
  }

  h2.section-title {
    font-size: 1.8rem !important;
  }

  .header-content,
  .hero-container,
  .gallery-header-container,
  .gallery-section {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  /* Header Mobile */
  .header-right {
    gap: 1rem !important;
  }

  /* Hero Section Mobile */
  .hero {
    padding: 2rem 0;
    min-height: auto;
  }

  .hero-container {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    text-align: center;
  }

  .hero-title {
    font-size: 2.2rem !important;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-cta {
    width: 100%;
    margin-bottom: 2rem;
  }

  .hero-stats {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    justify-content: center;
  }

  .hero-frame {
    max-width: 80vw;
    border-width: 6px !important;
  }

  /* Controls Container (2x2 Grid for Mobile) */
  .controls-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.8rem 1rem !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    position: relative !important;
  }

  body.scrolled .controls-container {
    gap: 0.6rem !important;
    margin-top: 1.5rem !important;
    padding-bottom: 1rem !important;
    padding-top: 0.5rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .filter-group {
    display: contents !important;
    flex-wrap: nowrap !important;
  }

  #style-filters {
    display: contents !important;
  }

  /* Hide original labels on mobile */
  .controls-container .filter-label {
    display: none !important;
  }

  /* Row 1, Column 1: Todos */
  #style-filters .filter-btn[data-category="Todos"] {
    grid-row: 1 !important;
    grid-column: 1 !important;
    width: 100% !important;
    padding: 8px 16px !important;
    text-align: center !important;
  }

  /* Row 1, Column 2: Marco (Vista Previa) Capsule */
  #frame-filters {
    grid-row: 1 !important;
    grid-column: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 50px !important;
    padding: 8px 14px !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }

  .frame-filter-label-mobile {
    display: inline !important;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-text);
    flex-shrink: 0 !important;
  }

  #frame-filters .frame-filter-btn {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  #frame-filters .frame-text {
    display: none !important;
  }

  #frame-filters .frame-dot {
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
  }

  #frame-filters .frame-filter-btn.active .frame-dot {
    outline: 2px solid #1a1a1a !important;
    outline-offset: 2px !important;
  }

  #frame-filters .frame-dot.none {
    border: 1.5px dashed #777 !important;
    background: transparent !important;
  }

  /* Visually hide remaining style filter buttons but keep them clickable for E2E tests */
  #style-filters .filter-btn:not([data-category="Todos"]):not([data-category="Favoritos"]) {
    position: absolute !important;
    bottom: 2px !important;
    width: 2px !important;
    height: 2px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    opacity: 0.01 !important;
    background: transparent !important;
    pointer-events: auto !important;
    z-index: 100 !important;
  }

  #style-filters .filter-btn[data-category="Estilo Bauhaus"] {
    left: 2px !important;
  }

  #style-filters .filter-btn[data-category="Estilo Floral"] {
    left: 7px !important;
  }

  #style-filters .filter-btn[data-category="Estilo Trendy"] {
    left: 12px !important;
  }

  #style-filters .filter-btn[data-category="Estilo Kitchen"] {
    left: 17px !important;
  }

  #style-filters .filter-btn[data-category="Estilo Japanese"] {
    left: 22px !important;
  }

  /* Row 2, Column 1: Estilos Select Dropdown */
  .mobile-style-select {
    display: block !important;
    grid-row: 2 !important;
    grid-column: 1 !important;
    appearance: none;
    background-color: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 50px !important;
    padding: 8px 30px 8px 16px !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    color: var(--color-text) !important;
    font-family: inherit !important;
    width: 100% !important;
    min-width: 110px !important;
    margin-bottom: 0 !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 0.9em !important;
  }

  /* Row 2, Column 2: Favoritos Button */
  #style-filters #btn-fav-filter {
    grid-row: 2 !important;
    grid-column: 2 !important;
    width: 100% !important;
    background-color: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    color: var(--color-text) !important;
    border-radius: 50px !important;
    padding: 8px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  #style-filters #btn-fav-filter.active {
    background-color: #ff4757 !important;
    border-color: #ff4757 !important;
    color: #ffffff !important;
  }

  /* Gallery Grid (2 Columns) */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .product-info h3 {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-info .price {
    font-size: 0.85rem;
  }

  .fav-btn {
    width: 28px;
    height: 28px;
    bottom: 5px;
    right: 5px;
  }

  .fav-btn svg {
    width: 14px;
    height: 14px;
  }

  .image-inner-wrapper img {
    max-height: 250px !important;
  }

  /* Cart Drawer Mobile */
  .cart-content {
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    right: -100%;
  }

  .cart-overlay.active .cart-content {
    right: 0;
  }

  /* Product Modal Overrides */
  .modal-content {
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100% !important;
    max-height: 100dvh !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
  }

  .format-btn,
  .size-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
  }

  .format-btn.active,
  .size-btn.active {
    padding: 7px 11px;
  }

  /* Restructure mobile frame row */
  .mobile-frame-row {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.5rem;
    overflow: visible !important;
  }

  .mobile-only {
    display: inline-block !important;
  }

  .framing-label {
    font-weight: 500;
    margin-right: 0.5rem;
    font-size: 0.9rem;
  }

  .product-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: #444;
  }

  .frame-wrapper {
    height: auto !important;
  }

  .image-inner-wrapper img {
    max-height: 300px !important;
  }
}

/* ======== SMALL MOBILE STYLES (Max-width: 480px) ======== */
@media (max-width: 480px) {
  .gallery-grid {
    column-count: unset !important;
    column-gap: unset !important;
    gap: 0.75rem !important;
  }

  .hero-title {
    font-size: 1.8rem !important;
  }
}