/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf8f5;
  --text: #2c2420;
  --accent: #8b5e3c;
  --accent-hover: #6d4a2e;
  --card-bg: #fff;
  --subtle: #f0ebe4;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(44,36,32,.08);
  --max-w: 1200px;
  --wa-green: #25d366;
  --danger: #c0392b;
  --success: #25a56a;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
hr { border: none; border-top: 1px solid rgba(0,0,0,.08); margin: 1rem 0; }

/* === NAV === */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(250,248,245,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
}
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; }
.logo img { border-radius: 6px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: 0.9rem; font-weight: 500; opacity: 0.7; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text); }
.nav-mobile-right { display: none; align-items: center; gap: 0.75rem; }

.cart-link, .cart-link-mobile { position: relative; display: flex; align-items: center; }
.cart-badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--accent); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* === HERO === */
.hero {
  position: relative;
  height: 85vh; min-height: 500px; max-height: 800px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: relative; z-index: 1;
  text-align: center; color: #fff; padding: 2rem;
  background: radial-gradient(ellipse, rgba(0,0,0,.45) 0%, transparent 70%);
  border-radius: 20px; max-width: 600px;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; margin-bottom: 0.5rem; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
.hero p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 1.5rem; text-shadow: 0 1px 8px rgba(0,0,0,.3); }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent); color: #fff;
  border-radius: 50px; font-weight: 600; font-size: 0.9rem;
  transition: background .2s, transform .15s;
  border: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.82rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-wa { background: var(--wa-green); }
.btn-wa:hover { background: #1da851; }
.btn-email { background: var(--accent); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a93226; }
.btn-add-cart {
  width: 100%; justify-content: center; margin-top: 0.75rem;
  padding: 0.6rem; font-size: 0.85rem;
}
.btn-add-cart-lg { padding: 0.85rem 2rem; }

/* === SECTIONS === */
.section { padding: 5rem 1.5rem; max-width: var(--max-w); margin: 0 auto; }
.page-section { padding-top: 6rem; min-height: 60vh; }
.section h2 { text-align: center; font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 0.5rem; }
.section-sub { text-align: center; opacity: 0.6; margin-bottom: 3rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.section-alt { max-width: 100%; background: var(--subtle); }
.section-alt > * { max-width: var(--max-w); margin-left: auto; margin-right: auto; }

/* === PRODUCT GRID === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(44,36,32,.12); }
.card-img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.card-body { padding: 1rem 1.25rem 1.25rem; }
.card-body h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.card-body a { color: inherit; }
.card-body a:hover h3 { color: var(--accent); }
.card-desc { font-size: 0.82rem; opacity: 0.6; margin-bottom: 0.4rem; }
.card-artist { font-size: 0.8rem; opacity: 0.5; margin-bottom: 0.5rem; }
.card-artist a { color: var(--accent); text-decoration: underline; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.card-price { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.card-badge {
  display: inline-block;
  background: var(--subtle); color: var(--accent);
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 50px;
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* === PRODUCT PAGE === */
.product-page {
  max-width: var(--max-w); margin: 0 auto;
  padding: 6rem 1.5rem 2rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  align-items: start;
}
.gallery-main-img { width: 100%; border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; }
.gallery-thumb {
  width: 70px; height: 70px; border-radius: 8px;
  object-fit: cover; cursor: pointer; opacity: 0.5;
  border: 2px solid transparent; transition: opacity .2s, border-color .2s;
}
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: var(--accent); }
.product-info { padding-top: 1rem; }
.product-info h1 { font-size: 1.8rem; margin: 0.5rem 0; }
.product-price { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin-bottom: 1rem; }
.product-price small { font-size: 0.8rem; opacity: 0.5; }
.product-desc { margin-bottom: 1.5rem; opacity: 0.7; }
.product-artist {
  background: var(--subtle); padding: 0.75rem 1rem; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: 0.9rem;
}
.product-artist a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.product-actions { display: flex; gap: 1rem; align-items: center; margin: 1.5rem 0; flex-wrap: wrap; }
.qty-control { display: flex; align-items: center; border: 1.5px solid rgba(0,0,0,.12); border-radius: 50px; overflow: hidden; }
.qty-control button {
  width: 40px; height: 40px; border: none; background: none;
  font-size: 1.2rem; cursor: pointer; color: var(--text);
}
.qty-control input {
  width: 50px; text-align: center; border: none; font-size: 1rem;
  background: none; -moz-appearance: textfield;
}
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; }
.out-of-stock { color: var(--danger); font-weight: 600; margin: 1rem 0; }
.low-stock { color: #e67e22; font-size: 0.85rem; margin-top: 0.5rem; }

/* === CART PAGE === */
.cart-empty { text-align: center; padding: 3rem 0; }
.cart-empty svg { margin: 0 auto 1rem; }
.cart-empty p { margin-bottom: 1.5rem; opacity: 0.5; font-size: 1.1rem; }
.cart-page { }
#cart-content { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }

.cart-items { }
.cart-item {
  display: flex; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  align-items: center;
}
.cart-item-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.cart-item-info .item-price { color: var(--accent); font-weight: 600; }
.cart-item-qty { display: flex; align-items: center; gap: 0.5rem; }
.cart-item-qty button {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); background: none;
  cursor: pointer; font-size: 1rem;
}
.cart-item-qty span { min-width: 24px; text-align: center; }
.cart-item-remove { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 0.8rem; opacity: 0.6; }
.cart-item-remove:hover { opacity: 1; }
.cart-item-total { font-weight: 700; min-width: 80px; text-align: right; }

.cart-sidebar {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
  position: sticky; top: 5rem;
}
.coupon-box { margin-bottom: 1.5rem; }
.coupon-box label { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; display: block; }
.coupon-input { display: flex; gap: 0.5rem; }
.coupon-input input {
  flex: 1; padding: 0.5rem 0.75rem; border: 1.5px solid rgba(0,0,0,.12);
  border-radius: 50px; font-size: 0.85rem; text-transform: uppercase;
}
.coupon-msg { font-size: 0.8rem; margin-top: 0.4rem; }
.coupon-msg.error { color: var(--danger); }
.coupon-msg.success { color: var(--success); }
.coupon-applied {
  display: flex; justify-content: space-between; align-items: center;
  background: #e8f5e9; padding: 0.5rem 0.75rem; border-radius: 8px;
  margin-top: 0.5rem; font-size: 0.85rem; color: var(--success);
}
.coupon-remove { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--danger); }

.cart-summary { margin-bottom: 1.5rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.95rem; }
.summary-total { font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--text); padding-top: 0.75rem; margin-top: 0.5rem; }
.discount-amount { color: var(--success); }

/* === CHECKOUT === */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
.checkout-form h3 { margin-bottom: 1rem; }
.checkout-guest-notice {
  background: var(--subtle); padding: 0.75rem 1rem; border-radius: var(--radius);
  margin-bottom: 1.5rem; font-size: 0.9rem;
}
.checkout-guest-notice a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.checkout-summary {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
  position: sticky; top: 5rem;
}
.checkout-summary h3 { margin-bottom: 1rem; }
.checkout-item { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.3rem 0; }
.checkout-item span:first-child { opacity: 0.7; }

.bank-details { margin-top: 2rem; }
.bank-details h3 { margin-bottom: 0.5rem; }
.bank-card {
  background: var(--subtle); padding: 1rem 1.25rem; border-radius: var(--radius);
  margin: 1rem 0; font-size: 0.9rem;
}
.bank-row { padding: 0.3rem 0; }
.bank-row span { opacity: 0.6; min-width: 70px; display: inline-block; }
.bank-note { font-size: 0.82rem; opacity: 0.6; font-style: italic; }

/* === AUTH === */
.auth-container { max-width: 400px; margin: 0 auto; padding-top: 2rem; }
.auth-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 2rem; box-shadow: var(--shadow);
}
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* === FORMS === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.65rem 0.85rem;
  border: 1.5px solid rgba(0,0,0,.12); border-radius: 8px;
  font-size: 0.9rem; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent);
}
.form-group input[type="checkbox"] { width: auto; margin-right: 0.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { color: var(--danger); font-size: 0.85rem; margin: 0.5rem 0; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; align-items: center; flex-wrap: wrap; }

/* === ACCOUNT === */
.account-layout { display: grid; grid-template-columns: 320px 1fr; gap: 2rem; margin-top: 2rem; }
.account-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); align-self: start;
}
.account-card h3 { margin-bottom: 1rem; }
.link-danger { color: var(--danger); font-size: 0.85rem; }
.text-muted { opacity: 0.5; }

.order-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.order-status {
  padding: 0.2rem 0.7rem; border-radius: 50px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.status-pending, .status-pendiente { background: #fff3e0; color: #e65100; }
.status-paid, .status-pagado { background: #e8f5e9; color: #2e7d32; }
.status-shipped, .status-enviado { background: #e3f2fd; color: #1565c0; }
.status-completed, .status-completado { background: #e8f5e9; color: #1b5e20; }
.status-cancelled, .status-cancelado { background: #fce4ec; color: #c62828; }
.order-date { font-size: 0.82rem; opacity: 0.5; margin-bottom: 0.5rem; }
.order-items-list { font-size: 0.9rem; }
.order-discount { font-size: 0.85rem; color: var(--success); margin-top: 0.3rem; }
.order-total { font-weight: 700; margin-top: 0.3rem; }

/* === FLASH === */
.flash {
  max-width: var(--max-w); margin: 5rem auto 0; padding: 0.75rem 1.5rem;
  border-radius: var(--radius); font-size: 0.9rem;
}
.flash-success { background: #e8f5e9; color: #2e7d32; }
.flash-error { background: #fce4ec; color: #c62828; }

/* === TOAST === */
.toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--text); color: #fff;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-size: 0.9rem; z-index: 300;
  animation: toastIn .3s ease, toastOut .3s ease 2.5s forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(20px); opacity: 0; } }

/* === ORDER SUCCESS MODAL === */
.order-success {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 2.5rem; max-width: 500px; text-align: center;
}
.order-success h2 { color: var(--success); margin-bottom: 1rem; }
.order-success p { margin-bottom: 0.75rem; }
.order-success .btn { margin-top: 1rem; }

/* === ABOUT === */
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-text p { margin-bottom: 1rem; }
.about-text strong { color: var(--accent); }
.about-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.about-imgs img { border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; }

/* === CONTACT === */
.contact-options { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* === FOOTER === */
footer { border-top: 1px solid rgba(0,0,0,.06); padding: 1.5rem; }
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; gap: 0.75rem;
  justify-content: center; font-size: 0.85rem; opacity: 0.5;
}

/* === MODAL === */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85);
  align-items: center; justify-content: center;
  flex-direction: column; padding: 1rem;
}
.modal.open { display: flex; }

/* === ADMIN === */
.admin-login {
  max-width: 350px; margin: 4rem auto; padding: 2rem;
  background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-login h1 { text-align: center; margin-bottom: 1.5rem; font-size: 1.3rem; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: var(--text); color: #fff;
  padding: 1.5rem; display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.admin-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; margin-bottom: 2rem; }
.admin-logo img { border-radius: 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.admin-nav a {
  padding: 0.6rem 0.75rem; border-radius: 8px; font-size: 0.9rem;
  opacity: 0.7; transition: all .2s; display: flex; align-items: center; justify-content: space-between;
}
.admin-nav a:hover, .admin-nav a.active { opacity: 1; background: rgba(255,255,255,.1); }
.admin-badge {
  background: var(--danger); font-size: 0.7rem;
  padding: 0.1rem 0.5rem; border-radius: 50px;
}
.admin-sidebar-footer { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1rem; }
.admin-sidebar-footer a { display: block; padding: 0.4rem 0; font-size: 0.85rem; opacity: 0.5; }
.admin-sidebar-footer a:hover { opacity: 1; }
.admin-main { flex: 1; padding: 2rem; margin-left: 220px; }
.admin-main h1 { margin-bottom: 1.5rem; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-header h1 { margin-bottom: 0; }

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg); padding: 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
}
.stat-number { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-alert .stat-number { color: var(--danger); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; text-transform: uppercase; opacity: 0.5; border-bottom: 2px solid var(--subtle); }
.admin-table td { padding: 0.75rem 1rem; border-bottom: 1px solid rgba(0,0,0,.04); font-size: 0.9rem; vertical-align: middle; }
.admin-table a { color: var(--accent); }
.admin-table code { background: var(--subtle); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.82rem; }

.admin-form { max-width: 700px; background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-order-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.admin-order-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.admin-order-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; font-size: 0.9rem; }
.inline-form { display: inline; }
.inline-form select { padding: 0.3rem 0.5rem; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); font-size: 0.82rem; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  #cart-content { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }
  .product-page { grid-template-columns: 1fr; padding-top: 5rem; }
  .admin-order-body { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-btn { display: block; }
  .nav-mobile-right { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(250,248,245,.98); backdrop-filter: blur(12px);
    flex-direction: column; padding: 1rem 1.5rem; gap: 1rem;
    border-bottom: 1px solid rgba(0,0,0,.06);
  }
  .nav-links .cart-link { display: none; }
  .nav-links.open { display: flex; }
  .about-content { grid-template-columns: 1fr; gap: 2rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .hero { height: 70vh; min-height: 400px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-sidebar { width: 100%; position: relative; }
  .admin-main { margin-left: 0; }
  .admin-layout { flex-direction: column; }
  .toast { left: 1rem; right: 1rem; bottom: 1rem; text-align: center; }
}
