/* ============================================================
   TERRACOTTA LENCERÍA - ESTILOS PRINCIPALES
   Diseño Cálido, Elegante, Minimalista y 100% Mobile-First
   ============================================================ */

:root {
  --color-primary: #C86D51;
  --color-primary-dark: #A95339;
  --color-primary-light: #E79C85;
  --color-accent: #E0A996;
  --color-bg: #FAF5F2;
  --color-surface: #FFFFFF;
  --color-card-bg: #FCF9F7;
  --color-text: #2C1E1A;
  --color-text-muted: #7E655E;
  --color-border: #EEDCD5;
  --color-success: #3E885B;
  --color-warning: #D9822B;
  --color-danger: #C0392B;
  --color-info: #3498DB;
  
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(180, 100, 80, 0.08);
  --shadow-md: 0 8px 24px rgba(180, 100, 80, 0.12);
  --shadow-lg: 0 16px 36px rgba(180, 100, 80, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 75px; /* Espacio para barra de navegación móvil */
}

html.catalog-restore-pending body {
  visibility: hidden;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tipografía */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0;
}

.nav-mark {
  display: inline-block;
  width: 22px;
  margin-right: 8px;
  color: var(--color-primary);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}

.trust-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border: 1px solid var(--color-primary-light);
  border-radius: 50%;
  color: var(--color-primary);
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 40px;
  text-align: center;
}

/* Contenedor */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.catalog-section {
  padding-top: 20px;
  margin-bottom: 50px;
  scroll-margin-top: 84px;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.catalog-header-simple {
  align-items: flex-start;
}

.flash-messages {
  margin-top: 15px;
}

.flash-messages .alert {
  margin-bottom: 0;
}

/* Barra superior de anuncios */
.top-bar {
  background-color: var(--color-primary-dark);
  color: #FFFFFF;
  font-size: 0.82rem;
  text-align: center;
  padding: 7px 15px;
  letter-spacing: 0.5px;
}
.top-bar strong {
  color: #FFE6DF;
}

/* Header Principal */
.header-main {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

@media (max-width: 991px) {
  .header-container {
    justify-content: center;
  }
}

.logo-wrapper {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 48px;
  width: auto;
}

.nav-desktop {
  display: none;
  gap: 28px;
}

.nav-desktop a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 0;
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--color-primary);
}

.nav-desktop a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-account-btn {
  display: none !important;
}

.desktop-user-btn {
  display: none;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.desktop-user-btn:hover {
  color: var(--color-primary-dark);
}

.account-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.account-heading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-logout {
  color: var(--color-danger);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.account-help,
.account-note {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.account-help {
  margin: 6px 0 18px;
}

.account-note {
  display: block;
  margin-top: 6px;
}

.account-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.cart-btn {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--color-primary);
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  height: 20px;
  min-width: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

@media (min-width: 992px) {
  .header-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .logo-wrapper {
    justify-self: start;
  }
  .nav-desktop {
    display: flex;
    justify-self: center;
  }
  .header-actions {
    justify-self: end;
  }
  .desktop-user-btn {
    display: block;
  }
  .desktop-account-btn {
    display: inline-flex !important;
  }
  .cart-btn {
    display: flex;
  }
}

/* Barra de Navegación Inferior (Mobile Bottom Navigation) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62px;
  background: #FFFFFF;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -3px 10px rgba(0,0,0,0.05);
  transition: none !important;
  animation: none !important;
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  gap: 2px;
  position: relative;
  padding: 6px;
  transition: none !important;
  animation: none !important;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--color-primary);
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 14px;
  background: var(--color-primary);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botones Principales */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(200, 109, 81, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.btn-secondary {
  background: #E8DDD7;
  color: var(--color-text);
}

.btn-secondary:hover {
  background: #D8C7C0;
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
}

.btn-whatsapp:hover {
  background: #1EBE5B;
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Alertas y Mensajes Flash */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: #EAF5EA;
  color: #276738;
  border: 1px solid #C3E6CB;
}

.alert-error, .alert-danger {
  background: #FDF0ED;
  color: #9C2A1E;
  border: 1px solid #F5C6CB;
}

.alert-warning {
  background: #FFF8E6;
  color: #8A6400;
  border: 1px solid #FFEBAA;
}

.alert-info {
  background: #EBF5FB;
  color: #1A5276;
  border: 1px solid #AED6F1;
}

.receipt-existing-alert {
  display: block;
  line-height: 1.45;
}

/* Hero Banner */
.hero-section {
  background: linear-gradient(135deg, #FBF4F1 0%, #F5E5E0 100%);
  padding: 40px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 35px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: center;
}

.store-status {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.store-status.is-open {
  color: #24613A;
  background: #E5F4EA;
}

.store-status.is-closed {
  color: #8A332C;
  background: #FBE9E7;
}

.store-hours-details {
  margin-top: 12px;
}

.store-hours-details summary {
  width: 100%;
  list-style: none;
}

.store-hours-details summary::-webkit-details-marker {
  display: none;
}

.store-hours-list {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card-bg);
  text-align: left;
}

.store-hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 0.8rem;
}

.store-hours-row + .store-hours-row {
  border-top: 1px solid var(--color-border);
}

.admin-hours-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.admin-hours-row .form-label {
  margin-bottom: 0;
}

.admin-hours-closed {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  font-size: 0.85rem;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .admin-hours-row {
    grid-template-columns: 1fr 1fr;
  }

  .admin-hours-row > strong,
  .admin-hours-closed {
    grid-column: span 2;
  }
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 20px 0;
  }
}

.hero-tag {
  display: inline-block;
  background: rgba(200, 109, 81, 0.15);
  color: var(--color-primary-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #311E18;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Filtros de Categorías */
.category-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 15px;
  padding-right: 16px;
  margin-bottom: 25px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.category-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  min-width: 0;
}

.category-filter-wrapper .category-filter-bar {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.category-scroll-btn {
  display: none;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: #FFF;
  color: var(--color-primary-dark);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

@media (min-width: 992px) {
  .category-filter-wrapper.has-overflow .category-scroll-btn {
    display: flex;
  }
}
.category-filter-bar::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 18px;
  border-radius: 30px;
  background: #FFF;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
}

.category-pill.active,
.category-pill:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFF;
}

/* Grilla de Productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
  }
}

/* Tarjeta de Producto */
.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.add-to-cart-form {
  margin-top: auto;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-thumb-link {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 125%; /* Relación de aspecto vertical ideal para moda/lencería */
  background: #FAF2EF;
  overflow: hidden;
}

.product-thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-thumb-img {
  transform: scale(1.05);
}

.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-cat {
  font-size: 0.75rem;
  color: var(--color-primary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-top: auto;
  margin-bottom: 12px;
}

/* Tarjetas y Paneles Generales */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

/* Formularios */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #FFF;
  color: var(--color-text);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(200, 109, 81, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Tablas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th, .table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.table th {
  background-color: #F8EFEA;
  color: var(--color-text);
  font-weight: 600;
}

/* Badges de Estado */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-warning { background: #FDEED9; color: #9B5500; }
.badge-info { background: #E1F0FA; color: #1E6091; }
.badge-success { background: #E3F5E9; color: #1D6F42; }
.badge-danger { background: #FCE8E6; color: #A9261E; }

/* Sección de Transferencia / Datos de Pago */
.bank-details-box {
  background: #FAF2EF;
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 15px 0;
}

.copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  margin-top: 6px;
  margin-bottom: 12px;
  font-family: monospace;
  font-size: 1rem;
}

/* Footer */
.footer-main {
  background: #251915;
  color: #D6C5BF;
  padding: 45px 0 25px 0;
  border-top: 1px solid #3E2B25;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1.5fr;
  }
}

.footer-title {
  color: #FFF;
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #D6C5BF;
}

.footer-links a:hover {
  color: var(--color-primary-light);
}

.social-icons-row {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.social-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #392822;
  color: #FFF;
  transition: all 0.2s;
}

.social-icon-btn:hover {
  background: var(--color-primary);
  color: #FFF;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #36251F;
  font-size: 0.82rem;
  color: #8C756E;
}

@media (max-width: 767px) {
  body {
    overflow-x: hidden;
    padding-bottom: 95px;
  }

  .mobile-bottom-nav {
    bottom: 18px;
  }

  .mobile-bottom-nav::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 18px;
    background: #FFFFFF;
    pointer-events: none;
  }

  .top-bar {
    font-size: 0.72rem;
    line-height: 1.35;
    padding: 6px 12px;
  }

  .header-container {
    height: 64px;
  }

  .logo-img {
    height: 42px;
  }

  .flash-messages {
    margin-top: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .flash-messages .alert {
    align-items: flex-start;
    padding: 10px 12px;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .hero-section {
    padding: 28px 0 32px;
    margin-bottom: 0;
  }

  .hero-grid {
    gap: 20px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 12px;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    margin-bottom: 18px;
  }

  .hero-section .btn {
    padding: 9px 14px;
    font-size: 0.84rem;
  }

  .hero-grid > div:last-child > div {
    max-width: none !important;
    padding: 14px !important;
    box-shadow: none !important;
  }

  .hero-grid > div:last-child img {
    display: none;
  }

  .catalog-section {
    padding-top: 24px;
    margin-bottom: 32px;
    scroll-margin-top: 76px;
  }

  .catalog-header {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .catalog-header h2 {
    font-size: 1.7rem;
  }

  .category-filter-bar {
    margin-bottom: 0;
    padding-bottom: 10px;
  }

  .category-filter-wrapper {
    margin-bottom: 18px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-thumb-link {
    padding-top: 78%;
  }

  .product-info {
    padding: 14px 16px 16px;
  }

  .product-title {
    font-size: 1.05rem;
  }

  .add-to-cart-form .btn {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .cart-page,
  .orders-page {
    padding-top: 24px !important;
    margin-bottom: 32px !important;
    min-width: 0;
  }

  .cart-layout-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
    min-width: 0;
  }

  .cart-layout-grid > *,
  .cart-items-card,
  .cart-summary-card {
    min-width: 0;
    max-width: 100%;
  }

  .account-page {
    padding-top: 24px !important;
    margin-bottom: 32px !important;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-heading h2 {
    font-size: 1.7rem;
  }

  .cart-items-card {
    padding: 10px !important;
    overflow: hidden;
  }

  .cart-items-card .table-responsive {
    max-width: 100%;
    overflow-x: auto;
  }

  .cart-items-card .table {
    min-width: 520px;
  }

  .cart-actions {
    justify-content: stretch !important;
  }

  .cart-actions > *,
  .cart-actions .btn {
    flex: 1 1 140px;
    text-align: center;
  }

  .cart-summary-card .btn {
    white-space: normal;
    line-height: 1.3;
  }

  .order-card {
    min-width: 0;
    padding: 16px !important;
  }

  .order-header > div,
  .order-item > span {
    min-width: 0;
  }

  .order-item {
    gap: 8px;
    flex-wrap: wrap;
  }

  .order-item > span:first-child {
    flex: 1 1 180px;
  }

  .order-item > span:last-child {
    margin-left: auto;
  }

  .order-actions {
    width: 100%;
    align-items: stretch !important;
  }

  .order-actions .btn {
    flex: 1 1 145px;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }
}

.receipt-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(37, 25, 21, 0.78);
}

.receipt-preview-modal.open {
  display: flex;
}

.receipt-preview-dialog {
  width: min(760px, 100%);
  max-height: min(90vh, 820px);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.receipt-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}

.receipt-preview-header h3 {
  font-size: 1.15rem;
}

.receipt-preview-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.receipt-preview-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: 68vh;
  padding: 18px;
  overflow: auto;
  background: #F7F1EE;
}

.receipt-preview-content img {
  max-width: 100%;
  max-height: 64vh;
  width: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.receipt-preview-content iframe {
  width: 100%;
  height: 64vh;
  min-height: 420px;
  border: 0;
  background: #FFF;
}

.product-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(37, 25, 21, 0.78);
}

.product-crop-modal.open {
  display: flex;
}

.product-crop-dialog {
  width: min(560px, 100%);
  max-height: 94vh;
  overflow: auto;
  padding: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.product-crop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.product-crop-header h3 {
  font-size: 1.25rem;
}

.product-crop-header p {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.product-crop-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.product-crop-stage {
  width: min(100%, 400px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #2B1D19;
  touch-action: none;
}

.product-crop-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

.product-crop-stage canvas:active {
  cursor: grabbing;
}

.product-crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px auto 0;
  width: min(100%, 400px);
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.product-crop-zoom input {
  flex: 1;
  accent-color: var(--color-primary);
}

.product-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.product-gallery {
  overflow: hidden;
  background: #FFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.product-gallery-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  background: #FAF2EF;
}

.product-gallery-stage > img {
  display: block;
  width: 100%;
  height: 550px;
  object-fit: contain;
}

.product-gallery-arrow {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 72px;
  transform: translateY(-50%);
  border: 0;
  background: rgba(43, 29, 25, 0.28);
  color: #FFF;
  font-family: Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.product-gallery-arrow:hover {
  background: rgba(43, 29, 25, 0.58);
}

.product-gallery-fullscreen {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(43, 29, 25, 0.32);
  color: #FFF;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.product-gallery-fullscreen:hover {
  background: rgba(43, 29, 25, 0.62);
}

.product-gallery-prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.product-gallery-next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.product-gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  background: #FFF;
}

.product-gallery-thumb {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #FAF2EF;
  cursor: pointer;
  opacity: 0.68;
}

.product-gallery-thumb.active,
.product-gallery-thumb:hover {
  border-color: var(--color-primary);
  opacity: 1;
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 16, 13, 0.94);
}

.product-gallery-lightbox.open {
  display: flex;
}

.product-gallery-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 74px;
}

.product-gallery-lightbox-stage > img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.product-gallery-lightbox-close,
.product-gallery-lightbox-arrow {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
  cursor: pointer;
  transition: background 0.2s ease;
}

.product-gallery-lightbox-close:hover,
.product-gallery-lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.product-gallery-lightbox-close {
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.product-gallery-lightbox-arrow {
  top: 50%;
  width: 52px;
  height: 92px;
  transform: translateY(-50%);
  font-family: Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
}

.product-gallery-lightbox-prev {
  left: 18px;
  border-radius: 0 10px 10px 0;
}

.product-gallery-lightbox-next {
  right: 18px;
  border-radius: 10px 0 0 10px;
}

.product-gallery-admin {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  overflow-x: auto;
}

.product-gallery-admin img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.primary-image-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  min-height: 78px;
  margin-bottom: 12px;
  padding: 6px 38px 6px 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-card-bg);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.primary-image-preview.is-empty {
  display: none;
}

.primary-image-preview img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 5px;
}

.image-remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  background: #F1DDD6;
  color: var(--color-danger);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.image-remove-btn:hover {
  background: var(--color-danger);
  color: #FFF;
}

@media (max-width: 520px) {
  .product-crop-dialog {
    padding: 15px;
  }

  .product-crop-actions .btn {
    flex: 1;
  }

  .product-gallery-stage > img {
    height: min(112vw, 520px);
  }

  .product-gallery-lightbox-stage {
    padding: 54px 48px;
  }

  .product-gallery-lightbox-arrow {
    width: 38px;
    height: 72px;
  }

  .product-gallery-lightbox-prev {
    left: 4px;
  }

  .product-gallery-lightbox-next {
    right: 4px;
  }
}

.receipt-preview-message {
  color: var(--color-text-muted);
  text-align: center;
}

