/* Las fichas de color y tipografía viven en base.css: aquí solo quedan
   los componentes que comparten tienda y panel. */



/* ===== Header ===== */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.logo { font-size: 1.25rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.logo span { color: var(--brand); }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 22px; align-items: center; }

/* En móvil el logo se acorta y la navegación secundaria cede el sitio */
@media (max-width: 640px) {
    .header-inner { gap: 8px; }
    .logo { font-size: 1rem; }
    .logo span { display: none; }
    .main-nav { gap: 14px; font-size: .92rem; }
    .main-nav a:not(.cart-link) { display: none; }
    .admin-header .main-nav a { display: inline; }
}
.main-nav a { color: var(--ink); font-weight: 600; }
.cart-link { position: relative; }
.cart-badge {
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    font-size: .72rem;
    padding: 1px 7px;
    margin-left: 2px;
    vertical-align: top;
}

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-weight: 600; }
.alert-success { background: #ecfdf5; color: var(--success); border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #ede9fe 0%, #fef3c7 100%);
    padding: 70px 0 60px;
    text-align: center;
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.15; margin-bottom: 16px; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }

.btn {
    display: inline-block;
    padding: 13px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--card); color: var(--ink); border: 2px solid var(--border); }
.btn-danger { background: transparent; color: var(--danger); border: none; cursor: pointer; font-size: .9rem; }
.btn-sm { padding: 8px 16px; font-size: .9rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ===== Steps / how it works ===== */
.steps { padding: 64px 0; }
.steps h2, .products-section h2, .effects-section h2 { text-align: center; font-size: 2rem; margin-bottom: 36px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.step-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 22px;
    text-align: center;
}
.step-card .step-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.step-card h3 { margin-bottom: 8px; font-size: 1.05rem; }
.step-card p { color: var(--muted); font-size: .95rem; }

/* ===== Effects showcase ===== */
.effects-section { padding: 24px 0 64px; }
.effects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.effect-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card);
}
.effect-card .effect-preview { height: 170px; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.effect-disney .effect-preview { background: linear-gradient(135deg, #c4b5fd, #fbcfe8, #fde68a); }
.effect-laser .effect-preview { background: repeating-linear-gradient(90deg, #c89b6d 0 14px, #b8865f 14px 28px, #c09468 28px 42px); }
.effect-original .effect-preview { background: linear-gradient(135deg, #dbeafe, #e0e7ff); }
.effect-card .effect-body { padding: 18px 20px; }
.effect-card h3 { margin-bottom: 6px; }
.effect-card p { color: var(--muted); font-size: .95rem; }

/* ===== Products ===== */
.products-section { padding: 24px 0 70px; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px; }
.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease, transform .15s ease;
}
.product-card:hover { box-shadow: 0 12px 30px rgba(31, 41, 55, .12); transform: translateY(-3px); }
.product-card .product-img { background: #f3f4f6; padding: 18px; height: 210px; display: flex; align-items: center; justify-content: center; }
.product-card .product-img img { max-height: 100%; }
.product-card .product-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card h3 { font-size: 1.08rem; }
.product-card .product-desc { color: var(--muted); font-size: .9rem; flex: 1; }
.product-card .product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-card .price { font-weight: 800; font-size: 1.15rem; color: var(--brand-dark); }

/* ===== Customizer ===== */
.customizer { padding: 40px 0 70px; }
.customizer h1 { margin-bottom: 6px; }
.customizer .sub { color: var(--muted); margin-bottom: 28px; }
.customizer-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 860px) { .customizer-grid { grid-template-columns: 1fr; } }

.mockup-stage {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.mockup-frame { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.mockup-frame > img.mockup-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.design-overlay {
    position: absolute;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.design-overlay img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.mockup-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
    padding: 30px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
}
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
}
.form-control:focus { outline: none; border-color: var(--brand); }
.form-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }

.dropzone {
    border: 2px dashed #c4b5fd;
    background: #f5f3ff;
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: background .15s ease;
}
.dropzone:hover, .dropzone.dragover { background: #ede9fe; }
.dropzone .dz-icon { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.dropzone p { color: var(--muted); font-size: .92rem; }
.dropzone strong { color: var(--brand-dark); }

.effect-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.effect-option {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    background: #fff;
    transition: border-color .12s ease, background .12s ease;
}
.effect-option.selected { border-color: var(--brand); background: #f5f3ff; }
.effect-option .eo-icon { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.effect-option input { display: none; }

.spinner {
    display: inline-block;
    width: 22px; height: 22px;
    border: 3px solid #ddd;
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-note { display: none; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; margin-top: 10px; }

.price-line { display: flex; justify-content: space-between; margin: 6px 0; }
.price-line.total { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }

/* ===== Cart / tables ===== */
.page-section { padding: 40px 0 70px; }
.page-section h1 { margin-bottom: 24px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-table th { background: #f9fafb; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cart-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.qty-input { width: 70px; }
.cart-summary { max-width: 380px; margin-left: auto; margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .es-icon { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ===== Checkout ===== */
.checkout-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.summary-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .95rem; }
.stripe-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; margin-top: 14px; }

/* ===== Success ===== */
.success-box { max-width: 640px; margin: 0 auto; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 46px 34px; }
.success-box .sb-icon { font-size: 3.4rem; display: block; margin-bottom: 12px; }
.success-box h1 { margin-bottom: 10px; }
.success-box p { color: var(--muted); margin-bottom: 8px; }
.order-summary-table { width: 100%; margin: 22px 0; border-collapse: collapse; text-align: left; }
.order-summary-table td, .order-summary-table th { padding: 9px 6px; border-bottom: 1px solid var(--border); }

/* ===== Auth / admin ===== */
.auth-box { max-width: 420px; margin: 60px auto; }
.admin-header { background: var(--ink); color: #fff; }
.admin-header .header-inner { height: 56px; }
.admin-header a { color: #e5e7eb; font-weight: 600; }
.admin-header .logo { color: #fff; font-size: 1.05rem; }
.admin-header .logo span { color: #c4b5fd; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 34px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; }
.stat-card .stat-label { color: var(--muted); font-size: .88rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-production { background: #dbeafe; color: #1e40af; }
.badge-shipped { background: #ede9fe; color: #5b21b6; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font-size: .88rem; font-weight: 600; }
.filter-bar a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: #d1d5db; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; padding: 34px 20px; flex-wrap: wrap; }
.site-footer a { color: #c4b5fd; }
.site-footer p { font-size: .92rem; }

/* ===== Paginación ===== */
.pagination { display: flex; gap: 6px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.page-link {
    display: inline-block;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-size: .9rem;
    font-weight: 600;
}
.page-link:hover { text-decoration: none; border-color: var(--brand); }
.page-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.disabled { color: #b6bcc6; background: transparent; border-color: transparent; }

/* ===== Inventario (panel) ===== */
.stock-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.stock-toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.stock-toolbar .form-group { margin-bottom: 0; }
.table-scroll { overflow-x: auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.badge-stock-ok { background: #d1fae5; color: #065f46; }
.badge-stock-low { background: #fef3c7; color: #92400e; }
.badge-stock-out { background: #fee2e2; color: #991b1b; }
.badge-stock-off { background: #e5e7eb; color: #4b5563; }
.stock-input { width: 92px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: .95rem; text-align: right; }
.stock-input:disabled { background: #f3f4f6; color: #9ca3af; }
.stock-row-out td { background: #fef2f2; }
.stock-row-low td { background: #fffbeb; }
.stock-adjust-panel { margin-bottom: 22px; }
.stock-bulk-bar { margin-top: 18px; }
.stock-delta-in { color: #047857; font-weight: 700; }
.stock-delta-out { color: #b91c1c; font-weight: 700; }

/* ===== Descuentos, empresas y cupones (panel) ===== */
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { margin: 0; }
.admin-head p { margin: 4px 0 0; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scope-group { margin-bottom: 22px; }
.scope-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.scope-head h2 { margin: 0; font-size: 1.15rem; }
.badge-neutral { background: #e5e7eb; color: #4b5563; }
/* Solo la lista de definiciones (dl): el panel usa .data-list también en <ul> */
dl.data-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; margin: 0; }
dl.data-list dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
dl.data-list dd { margin: 2px 0 0; font-size: .95rem; }
.form-divider { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

/* ===== Panel: navegación agrupada ===== */
.admin-subnav { background: #111827; border-top: 1px solid rgba(255, 255, 255, .08); position: sticky; top: 56px; z-index: 49; }
.admin-subnav-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 20px; }
.admin-nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.admin-nav-group + .admin-nav-group { border-left: 1px solid rgba(255, 255, 255, .14); padding-left: 14px; }
.admin-nav-group-label { color: #9ca3af; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-right: 2px; }
.admin-nav-link { color: #d1d5db; font-size: .88rem; font-weight: 600; padding: 5px 10px; border-radius: 8px; }
.admin-nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.admin-nav-link.active { background: var(--brand); color: #fff; }
@media (max-width: 640px) {
    .admin-subnav { position: static; }
    .admin-nav-group + .admin-nav-group { border-left: 0; padding-left: 0; }
}

/* ===== Panel: cuadro de mando ===== */
.panel-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 22px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 34px; align-items: start; }
.dash-subtitle { font-size: .95rem; margin: 18px 0 6px; }
.trend { font-size: .82rem; font-weight: 700; margin-top: 4px; }
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--muted); }
/* Lista apilada del cuadro de mando. Con nombre propio para no chocar con la
   rejilla `dl.data-list` de más arriba, cuyo `display:grid` rompía estas filas. */
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.dash-list li:last-child { border-bottom: 0; }
.workshop-load { margin-bottom: 16px; }
.workshop-load:last-child { margin-bottom: 0; }
.meter { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; background: var(--brand); }
.badge-ready { background: #fef9c3; color: #854d0e; }
.badge-delivered { background: #dcfce7; color: #166534; }
.badge-late { background: #fee2e2; color: #991b1b; margin-left: 6px; }

/* ===== Panel: ajustes ===== */
.setting-row { padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.setting-row:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-check { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: .92rem; cursor: pointer; }
.setting-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.setting-help { margin-top: 5px; }
.setting-json { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.setting-key { margin-top: 5px; opacity: .7; }
.setting-key code { background: #f3f4f6; border-radius: 5px; padding: 1px 6px; font-size: .8rem; }

/* ===== Panel: catálogo (productos, familias y variantes) ===== */
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* Buscador del listado: campo ancho y filtros a su lado */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search-bar input[type="search"] { flex: 1 1 260px; }
.search-bar select { flex: 0 1 220px; }

/* Casillas con su etiqueta en línea, sin el bold de .form-group label */
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 6px; cursor: pointer; }
.check-line input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); }
.check-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 4px 0; }
.check-row .check-line { margin-bottom: 0; }
.days-input { width: 92px; flex: none; }

/* Dos paneles a la par (alta de variante y generador) */
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .form-columns { grid-template-columns: 1fr; } }

/* Tabla de variantes: muchas columnas editables en poco sitio */
.compact-table th, .compact-table td { padding: 8px 10px; font-size: .9rem; }
.compact-table .input-sm { padding: 6px 8px; font-size: .88rem; }
.compact-table tr.row-warning { background: #fffbeb; }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); vertical-align: middle; margin-right: 5px; }

.chip { display: inline-block; background: #f3f4f6; border-radius: 999px; padding: 2px 9px; font-size: .78rem; margin: 0 3px 3px 0; }
.badge-warning { background: #fef3c7; color: #92400e; }
.margin-low { color: var(--danger); font-weight: 700; }

/* ===== Envíos y talleres (panel) ===== */
/* Matriz de tarifas: muchas casillas pequeñas, una fila por método */
.matrix-table { width: 100%; border-collapse: collapse; }
.matrix-table th, .matrix-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.matrix-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.matrix-table td { font-size: .92rem; }
.matrix-table input[type="number"] {
    width: 104px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-size: .9rem;
    font-family: inherit;
}
.matrix-table input[type="number"]:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
/* Tarifa desactivada: sigue editándose, pero se ve que no está en juego */
.matrix-table tr.is-off td:not(:first-child) { opacity: .55; }
.zone-block h3 { font-size: 1.05rem; }
.sim-result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Rejilla de casillas para seleccionar varios elementos a la vez */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px 16px;
    margin-top: 6px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: .92rem;
}
