/* Global */
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: #f8fafc; color: #0f172a; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.site-main { min-height: calc(100vh - 120px); }
.site-footer { background: #0f172a; color: #cbd5e1; padding: 40px 20px; }
.footer-grid { display: grid; gap: 24px; max-width: 1120px; margin: 0 auto; }
.footer-grid h3, .footer-grid h4 { color: #fff; }
.footer-grid a { display: block; color: #94a3b8; margin-bottom: 8px; }
.footer-bottom { text-align: center; margin-top: 24px; font-size: 14px; }
.whatsapp-float { position: fixed; right: 20px; bottom: 20px; background: #25d366; color: #fff; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 50; }

.site-nav { background: #0f172a; color: #fff; position: sticky; top: 0; z-index: 40; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 14px 20px; }
.brand { display: flex; gap: 12px; align-items: center; color: #fff; font-weight: 700; }
.logo { height: 64px; width: auto; max-width: 180px; object-fit: contain; mix-blend-mode: screen; filter: brightness(1.1); }
.nav-links { display: flex; gap: 18px; align-items: center; }
.nav-links a { color: #cbd5e1; padding: 8px 12px; border-radius: 10px; transition: background .2s; }
.nav-links a:hover { background: rgba(255,255,255,.08); }
.nav-toggle { background: none; border: none; color: #fff; font-size: 24px; display: none; }

.page-section { padding: 60px 20px; max-width: 1120px; margin: 0 auto; }
.section-heading { margin-bottom: 36px; }
.section-heading.center { text-align: center; }
.section-heading h1, .section-heading h2 { font-size: clamp(2rem, 1.8vw, 3rem); margin: 0 0 16px; }
.section-heading p { color: #64748b; max-width: 760px; line-height: 1.8; }

.hero { background: #0f172a; color: #fff; padding: 72px 20px; }
.hero-content { display: grid; gap: 32px; max-width: 1120px; margin: 0 auto; grid-template-columns: 1.2fr 1fr; align-items: center; }
.hero .eyebrow { margin-bottom: 18px; font-size: .96rem; letter-spacing: .08em; text-transform: uppercase; color: #60a5fa; }
.hero h1 { margin: 0 0 20px; font-size: clamp(2.5rem, 3.5vw, 4.75rem); line-height: 1.05; }
.hero p { max-width: 600px; color: #cbd5e1; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hero-image { display: flex; justify-content: center; }
.hero-image img { border-radius: 28px; box-shadow: 0 30px 80px rgba(15,23,42,.25); }

.button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 26px; border-radius: 999px; border: none; cursor: pointer; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: #2563eb; color: #fff; }
.button-secondary { background: rgba(255,255,255,.12); color: #fff; }
.button-white { background: #fff; color: #0f172a; }
.admin-form .button-secondary { background: #f8fafc; color: #0f172a; border: 1px solid #cbd5e1; }
.admin-form .button-secondary:hover { background: #eef2ff; }
.button-sm { padding: 10px 18px; font-size: .95rem; }
.text-link { color: #2563eb; }

.trust-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 40px 20px; max-width: 1120px; margin: 0 auto; }
.trust-grid article { background: #fff; border-radius: 24px; padding: 28px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.trust-grid h3 { margin: 0 0 12px; }
.trust-grid p { color: #64748b; margin: 0; }

.featured-products { padding: 60px 20px; max-width: 1120px; margin: 0 auto; }
.featured-products .section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.featured-products .section-header > div { max-width: 680px; }
.product-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.product-card { background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.product-card-image-wrapper { position: relative; width: 100%; height: 240px; overflow: hidden; }
.product-card-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { display: flex; align-items: center; justify-content: center; height: 240px; background: #e2e8f0; color: #64748b; }
.product-badge-agotado { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.8); color: #fff; padding: 12px 24px; border-radius: 8px; font-weight: 700; font-size: 1.1rem; z-index: 10; }
.product-card-body { padding: 22px; }
.product-card-body h3 { margin: 0 0 10px; font-size: 1.25rem; }
.product-price { display: block; margin-bottom: 10px; font-weight: 700; color: #2563eb; }
.product-stock { display: inline-block; color: #16a34a; font-size: .9rem; }
.product-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }

.cta-band { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; background: #2563eb; color: #fff; padding: 44px 32px; border-radius: 32px; margin: 60px auto; max-width: 1120px; }
.cta-band > div { max-width: 760px; }
.cta-band h2 { margin: 0; }
.cta-band p { margin: 0; color: rgba(255,255,255,.9); }

.shop-grid { display: grid; gap: 24px; grid-template-columns: 300px minmax(0, 1fr); }
.shop-sidebar .card, .card { background: #fff; border-radius: 24px; padding: 24px; box-shadow: 0 20px 40px rgba(15,23,42,.06); }
.search-form input, .search-form button, .admin-form input, .admin-form textarea, .admin-form select { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.search-form button { background: #2563eb; color: #fff; border: none; }
.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li { margin-bottom: 10px; }
.category-list a { display: block; padding: 10px 14px; border-radius: 12px; color: #334155; }
.category-list a.active { background: #eef2ff; color: #2563eb; }

.product-page .product-layout { display: grid; gap: 32px; grid-template-columns: 1.1fr .9fr; }
.product-gallery .main-product-image { border-radius: 30px; }
.thumbnail-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px; margin-top: 16px; }
.thumbnail { border-radius: 18px; height: 90px; object-fit: cover; }
.product-details { display: flex; flex-direction: column; gap: 20px; }
.product-header { display: flex; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-flex; padding: 10px 14px; border-radius: 999px; background: #eff6ff; color: #2563eb; font-size: .9rem; }
.badge-stock { background: #dcfce7; color: #166534; }
.product-price-large { font-size: 2.5rem; margin: 0; color: #2563eb; }
.product-description p { color: #475569; line-height: 1.8; }
.product-specs pre { background: #f8fafc; border: 1px solid #e2e8f0; padding: 18px; border-radius: 18px; overflow-x: auto; white-space: pre-wrap; }
.product-promises { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: .95rem; color: #475569; }

.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-actions .button-secondary { background: #f1f5f9; color: #0f172a; border: 1px solid #cbd5e1; }
.admin-actions .button-secondary:hover { background: #e2e8f0; }
.admin-actions .button { min-width: 130px; }
.admin-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.admin-table th, .admin-table td { padding: 16px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle; overflow: hidden; }
.admin-table th { background: #f8fafc; color: #334155; }
.admin-table th:nth-child(1), .admin-table td:nth-child(1) { width: 50%; }
.admin-table th:nth-child(4), .admin-table td:nth-child(4) { width: 15%; text-align: right; min-width: 170px; }
.admin-table td:last-child { min-width: 170px; }
.admin-table th:nth-child(3), .admin-table td:nth-child(3) { width: 20%; text-align: center; }
.admin-table th:nth-child(4), .admin-table td:nth-child(4) { width: 15%; text-align: right; min-width: 170px; }
.admin-table td:last-child { min-width: 170px; }
.product-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.product-cell img { width: 50px; height: 50px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.product-cell span { min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-actions-row { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.admin-actions-row .link-action { white-space: nowrap; border-radius: 999px; padding: 8px 12px; font-size: .95rem; transition: background .2s, color .2s, border-color .2s; border: 1px solid #cbd5e1; background: #fff; }
.admin-actions-row .link-action:hover { background: #eff6ff; }
.link-action { color: #2563eb; background: #fff; border: 1px solid #cbd5e1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.link-action.delete { color: #dc2626; border-color: rgba(220, 38, 38, .25); }
.link-action.delete:hover { background: rgba(220, 38, 38, .08); }

/* Keep forms and buttons inline inside actions column to prevent wrapping */
.admin-table td:last-child .admin-actions-row { flex-wrap: nowrap; }
.admin-table td:last-child form { display: inline-block; margin: 0; }
.admin-table td:last-child form .link-action { display: inline-flex; }
.admin-table td:last-child a.link-action { display: inline-flex; }

/* Ensure product name has enough space and is truncated cleanly */
.product-cell span { flex: 1 1 auto; min-width: 0; max-width: 100%; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-filter-card { margin-bottom: 18px; padding: 18px 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; background: #fff; border-radius: 20px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.admin-filter-card .filter-group { display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.admin-filter-card select { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; background: #fff; }
.admin-filter-card .filter-actions { display: flex; gap: 10px; align-items: center; }

.pagination { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination .button { border-radius: 999px; padding: 10px 16px; }
.pagination .button-secondary { border-color: #cbd5e1; background: #fff; color: #0f172a; }
.pagination .button-current { background: #2563eb; color: #fff; border-color: transparent; }
.button-disabled { opacity: .6; pointer-events: none; color: #64748b; border: 1px solid #cbd5e1; background: #f8fafc; }

@media (max-width: 720px) {
  .admin-filter-card { display: grid; grid-template-columns: 1fr; }
  .admin-filter-card .filter-actions { justify-content: flex-start; width: 100%; }
}

/* Responsive: transform table into stacked cards on small screens */
@media (max-width: 720px) {
  .admin-table { display: block; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: block; }
  .admin-table tbody tr { display: block; background: transparent; margin-bottom: 18px; border-radius: 12px; }
  .admin-table tbody tr td { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: none; }
  .admin-table tbody tr td[data-label] { width: 100%; }
  .admin-table tbody tr td::before { content: attr(data-label) ": "; font-weight: 700; color: #334155; margin-right: 8px; }
  .admin-table tbody tr td .product-cell { width: 100%; }
  .admin-table td:last-child { display: flex; gap: 8px; justify-content: flex-end; }
}

.admin-form label { display: block; margin-bottom: 8px; font-weight: 600; }
.admin-form input[type="text"], .admin-form input[type="number"], .admin-form input[type="email"], .admin-form textarea, .admin-form select { margin-bottom: 18px; }
.admin-form .checkbox-field { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 600; }
.admin-form .checkbox-field input[type="checkbox"] { margin: 0; width: auto; height: auto; }
.form-actions { display: flex; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.alert { padding: 16px; border-radius: 16px; margin-bottom: 20px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.contact-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.contact-info p { margin: 0 0 16px; color: #475569; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label { display: block; margin-bottom: 8px; font-weight: 600; }
.contact-form input, .contact-form textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; background: #fff; color: #0f172a; }
.contact-form textarea { min-height: 180px; resize: vertical; }
.contact-form button { align-self: flex-start; margin-top: 6px; }
.banner-card { background: #2563eb; color: #fff; padding: 32px; border-radius: 24px; text-align: center; }
.gallery-preview { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.gallery-preview img { width: 90px; height: 90px; object-fit: cover; border-radius: 16px; }
.product-placeholder.large { height: 360px; display: flex; align-items: center; justify-content: center; background: #e2e8f0; color: #64748b; border-radius: 24px; }

@media (max-width: 996px) {
  .hero-content, .shop-grid, .product-layout, .contact-grid, .trust-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; flex-direction: column; width: 100%; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 40px 20px; }
  .cta-band { justify-content: center; text-align: center; }
  .cta-band > div { width: 100%; }
}

@media (max-width: 680px) {
  .nav-inner { flex-wrap: wrap; gap: 16px; }
  .hero h1 { font-size: 2.5rem; }
  .product-promises { grid-template-columns: 1fr; }
}
