:root{
	--bg:#f7f7f8;
	--card:#ffffff;
	--muted:#6b7280;
	--accent:#0f172a;
}
*{box-sizing:border-box}
body{font-family:Inter,system-ui,Arial,Helvetica,sans-serif;margin:0;background:var(--bg);color:var(--accent)}
header{display:flex;justify-content:space-between;align-items:center;padding:1rem 2rem;background:transparent}
nav a{margin-left:.75rem;color:var(--accent);text-decoration:none}
main{padding:0}
body.dialog-open{overflow:hidden}

/* DIALOG */
.dialog-root{position:fixed;inset:0;pointer-events:none;z-index:9999}
.dialog-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:1.25rem;background:rgba(15,23,42,.45);backdrop-filter:blur(6px);pointer-events:auto}
.dialog-card{width:min(100%,440px);background:linear-gradient(180deg,#ffffff,#f8fafc);border:1px solid rgba(15,23,42,.08);border-radius:20px;box-shadow:0 24px 60px rgba(15,23,42,.2);padding:1.25rem 1.25rem 1rem;outline:none}
.dialog-card-default{border-top:6px solid #0b89ff}
.dialog-card-danger{border-top:6px solid #dc2626}
.dialog-card-product{width:min(100%,860px);max-height:min(88vh,760px);border-top:6px solid #0b89ff;overflow:hidden;display:flex;flex-direction:column}
.dialog-eyebrow{font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#64748b;margin-bottom:.65rem}
.dialog-title{margin:0 0 .6rem;font-size:1.25rem;line-height:1.1;color:#0f172a}
.dialog-message{margin:0;color:#475569;line-height:1.5}
.dialog-actions{display:flex;justify-content:flex-end;gap:.75rem;margin-top:1.25rem}
.dialog-btn{border:none;border-radius:12px;padding:.72rem 1rem;font-weight:700;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
.dialog-btn:hover{transform:translateY(-1px)}
.dialog-btn-primary{background:linear-gradient(180deg,#0b89ff,#0666d6);color:#fff;box-shadow:0 12px 24px rgba(6,102,214,.18)}
.dialog-btn-secondary{background:#e2e8f0;color:#0f172a}
.dialog-card-product .dialog-actions{margin-top:1rem;flex-shrink:0}
.product-dialog-body{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:1.25rem;align-items:stretch;flex:1;min-height:0;overflow:auto;padding-right:.25rem}
.product-dialog-media{min-height:340px;background:linear-gradient(135deg,#eef2ff,#f8fafc);border-radius:18px;display:flex;align-items:center;justify-content:center;padding:1rem;overflow:hidden;position:relative}
.product-dialog-media img{width:100%;height:100%;object-fit:contain}
.product-dialog-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:240px;color:#64748b;font-weight:700;background:rgba(255,255,255,.65);border-radius:14px}
.product-dialog-content{display:flex;flex-direction:column;justify-content:flex-start;gap:.85rem;padding:.35rem 0;min-height:0}
.product-dialog-price{margin:0;font-size:1.45rem;font-weight:800;color:#0b89ff}
.product-dialog-thumbs{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:.25rem}
.product-dialog-thumb{width:72px;height:72px;border:1px solid rgba(15,23,42,.1);border-radius:14px;padding:.2rem;background:#fff;cursor:pointer;overflow:hidden}
.product-dialog-thumb img{width:100%;height:100%;object-fit:cover;border-radius:10px}
.product-dialog-thumb.is-active{border-color:#0b89ff;box-shadow:0 0 0 3px rgba(11,137,255,.16)}
.product-dialog-description{min-height:140px;max-height:220px;overflow:auto;padding-right:.45rem;white-space:pre-line;overscroll-behavior:contain}
.product-dialog-body::-webkit-scrollbar,.product-dialog-description::-webkit-scrollbar{width:8px}
.product-dialog-body::-webkit-scrollbar-thumb,.product-dialog-description::-webkit-scrollbar-thumb{background:rgba(107,114,128,.35);border-radius:999px}

/* HERO / BANNER */
.hero{height:100vh;display:flex;align-items:flex-end;justify-content:flex-start;position:relative;color:white;overflow:hidden;margin-bottom:2.5rem;padding-left:3rem;padding-bottom:10vh}
.hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:brightness(.6);transform:scale(1.02);}
.hero-inner{max-width:1100px;padding:2rem;text-align:left;position:relative;z-index:2}
.hero-title{font-size:clamp(2.2rem,4vw,3.6rem);margin:0 0 .5rem}
.hero-sub{margin:0 0 1rem;color:rgba(255,255,255,0.9)}
.hero-cta{display:inline-block;background:#fff;color:#0b1220;padding:.6rem 1rem;border-radius:8px;text-decoration:none;font-weight:600}

/* CATALOG */
.catalog-section{max-width:1300px;margin:3rem auto;padding:2rem;background:transparent}
.catalog-notice{margin:0 0 1.5rem;padding:1rem 1.25rem;border-radius:16px;background:linear-gradient(135deg,#fff7ed,#fffbeb);border:1px solid rgba(245,158,11,.28);box-shadow:0 12px 30px rgba(245,158,11,.08)}
.catalog-notice-label{margin:0 0 .35rem;font-size:.78rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#b45309}
.catalog-notice-text{margin:0;font-size:1rem;line-height:1.5;color:#7c2d12}
.section-title{margin:0 0 1.25rem;font-size:1.6rem;font-weight:700;padding:0;font-family:inherit}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem}

/* CARD */
.card{background:var(--card);border-radius:10px;overflow:hidden;display:flex;flex-direction:column;min-height:320px;box-shadow:0 6px 18px rgba(15,23,42,0.06);transition:transform .18s ease,box-shadow .18s ease;border:1px solid rgba(15,23,42,0.04)}
.card:hover{transform:translateY(-6px);box-shadow:0 18px 40px rgba(15,23,42,0.12)}
.grid .card{cursor:pointer}
.grid .card:focus-visible{outline:3px solid rgba(11,137,255,.35);outline-offset:4px}
.card-media{height:160px;background:linear-gradient(135deg,#eef2ff,#f0fdf4);display:flex;align-items:center;justify-content:center}
.card-img{width:100%;height:100%;object-fit:contain}
.card-body{padding:1rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.card-title{font-size:1rem;margin:0;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card-desc{margin:0;color:var(--muted);font-size:.9rem;flex:1;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.card-price{margin:0;font-weight:700}

@media(min-width:900px){.catalog-section{margin-top:6rem;padding:3rem}}

/* Ajustes del hero en escritorio: mover contenido un poco abajo y a la izquierda */
@media(min-width:900px){
	.hero{justify-content:flex-start;padding-left:20rem;align-items:flex-end;padding-bottom:10vh}
	.hero-inner{transform:none}
}

@media(max-width:600px){.hero{background-position: top center}.card-media{height:120px}.card{min-height:260px}}
@media(max-width:600px){.dialog-actions{flex-direction:column}.dialog-btn{width:100%}.dialog-overlay{padding:.75rem;align-items:center;justify-content:center}.dialog-card{padding:1rem}.dialog-card-product{width:100%;max-height:calc(100dvh - 1.5rem);border-radius:24px}.product-dialog-body{grid-template-columns:1fr;gap:1rem;padding-right:0}.product-dialog-media{min-height:220px;max-height:34dvh;padding:.75rem}.product-dialog-content{gap:.7rem;padding:0;min-height:0}.product-dialog-thumb{width:64px;height:64px}.product-dialog-description{min-height:150px;max-height:150px;padding-right:.2rem}.dialog-card-product .dialog-actions{margin-top:.85rem;padding-top:.85rem;border-top:1px solid rgba(15,23,42,.08)}}
@media(max-width:420px){.dialog-overlay{padding:.5rem;align-items:center;justify-content:center}.dialog-card-product{max-height:calc(100dvh - 1rem);border-radius:22px;padding:.9rem}.dialog-eyebrow{margin-bottom:.5rem}.dialog-title{font-size:1.1rem}.product-dialog-price{font-size:1.2rem}.product-dialog-media{min-height:200px;max-height:30dvh}.product-dialog-thumbs{gap:.5rem}.product-dialog-thumb{width:58px;height:58px}.product-dialog-description{min-height:140px;max-height:140px}}

/* small helpers */
.section-title{padding:0 0 0 0;margin-left:0}
.hero .hero-cta:focus{outline:3px solid rgba(255,255,255,0.2)}

/* AUTH / LOGIN */

/* AUTH / LOGIN */
.auth-container{display:flex;align-items:center;justify-content:center;padding:3rem 1rem}
.auth-card{width:100%;max-width:540px;background:var(--card);padding:1.5rem;border-radius:14px;box-shadow:0 12px 40px rgba(15,23,42,0.08);border:1px solid rgba(15,23,42,0.04)}
.auth-title{margin:0 0 0.75rem;font-size:1.35rem;color:var(--accent)}
.auth-form{display:flex;flex-direction:column;gap:1rem}
.field{display:flex;flex-direction:column;font-size:.95rem;color:var(--muted)}
.field input, .field textarea{margin-top:.5rem;padding:.65rem .9rem;border-radius:10px;border:1px solid rgba(15,23,42,0.06);background:transparent;font-size:0.95rem}
.field textarea{min-height:90px;resize:vertical}
.field input:focus, .field textarea:focus{outline:3px solid rgba(59,130,246,0.12);border-color:rgba(59,130,246,0.35)}
.actions{display:flex;justify-content:flex-end;margin-top:.25rem}
.btn-primary{background:linear-gradient(180deg,#0b1220,#0f172a);color:#fff;padding:.65rem 1rem;border-radius:10px;border:none;font-weight:700;cursor:pointer}
.btn-primary:hover{transform:translateY(-3px);box-shadow:0 18px 40px rgba(11,18,32,0.12)}

@media(max-width:520px){.auth-card{padding:1rem;margin:0 0.5rem}}

/* ADMIN AREA */
/* ADMIN AREA */
#userArea{padding:0}

.admin-container{padding:1rem;margin-top:1rem}
.admin-grid{display:grid;grid-template-columns:320px 1fr;gap:1.5rem}
.admin-panel{background:var(--card);padding:1rem;border-radius:12px;border:1px solid rgba(15,23,42,0.04);box-shadow:0 10px 30px rgba(15,23,42,0.04)}
.admin-main{background:transparent}
.admin-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}
.admin-header p{margin:0;font-weight:700}
.admin-header button{background:transparent;border:1px solid rgba(15,23,42,0.08);padding:.45rem .7rem;border-radius:8px;cursor:pointer}

/* Admin: complete redesigned shell */
.admin-root{padding:1rem}
.admin-shell{max-width:1200px;margin:1.5rem auto;background:transparent}
.admin-topbar{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.25rem;border-radius:12px;margin-bottom:1rem;background:linear-gradient(180deg,#ffffff,#fbfdff);box-shadow:0 8px 30px rgba(11,18,32,0.04);border:1px solid rgba(15,23,42,0.04)}
.admin-topbar .brand{display:flex;align-items:center;gap:.75rem}
.logo{width:44px;height:44px;border-radius:8px;background:linear-gradient(135deg,#0b89ff,#0666d6);color:white;display:flex;align-items:center;justify-content:center;font-weight:800}
.brand-name{font-weight:800}
.brand-sub{font-size:.85rem;color:var(--muted)}
.topbar-actions{display:flex;align-items:center;gap:.75rem}
.btn-ghost{background:transparent;border:1px solid rgba(15,23,42,0.06);padding:.45rem .65rem;border-radius:8px;cursor:pointer}

.admin-body{display:grid;grid-template-columns:260px 1fr;gap:1rem}
.sidebar{background:var(--card);padding:1rem;border-radius:12px;border:1px solid rgba(15,23,42,0.04);box-shadow:0 8px 30px rgba(11,18,32,0.03);display:flex;flex-direction:column;justify-content:space-between}
.sidebar-nav ul{list-style:none;padding:0;margin:0}
.sidebar-nav ul li{margin-bottom:.5rem}
.sidebar-nav ul li a{display:block;padding:.65rem .6rem;border-radius:8px;color:var(--accent);text-decoration:none;font-weight:700}
.sidebar-nav ul li a:hover{background:rgba(11,137,255,0.06)}
.sidebar-nav ul li a:focus,
.sidebar-nav ul li a:active,
.sidebar-nav ul li a.active{background:linear-gradient(90deg,#eef6ff,#f8fbff);color:#044f9e;outline:none}
/* stronger active indicator */
.sidebar-nav ul li a.active{border-left:4px solid #0666d6;padding-left:0.55rem}

.sidebar-footer{font-size:.85rem;color:var(--muted)}

.content{display:flex;flex-direction:column;gap:1rem}
.content-header{display:flex;justify-content:space-between;align-items:center}
.content-title{font-size:1.15rem;font-weight:800}
.content-actions{display:flex;gap:.75rem;align-items:center}
#adminSearch{padding:.55rem .75rem;border-radius:10px;border:1px solid rgba(15,23,42,0.06);min-width:260px}
.small{padding:.45rem .7rem;font-size:.95rem}

.panel{background:transparent}
.panel-inner{background:var(--card);padding:1rem;border-radius:12px;border:1px solid rgba(15,23,42,0.04);box-shadow:0 8px 30px rgba(11,18,32,0.03)}

.products-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem;justify-items:center}
.products-list{display:flex;flex-direction:column;gap:1rem}
.product-card{background:linear-gradient(180deg,#fff,#fbfdff);border-radius:16px;padding:0;overflow:hidden;border:1px solid rgba(15,23,42,0.04);box-shadow:0 8px 30px rgba(11,18,32,0.03);display:grid;grid-template-columns:190px minmax(0,1fr) 220px;width:100%;min-height:160px}
.product-media{height:160px;min-height:160px;background:#f3f5f9;display:flex;align-items:center;justify-content:center;padding:.75rem}
.product-media img{width:100%;height:100%;object-fit:contain}
.product-body{padding:1.25rem;display:flex;flex-direction:column;justify-content:center;gap:.65rem;min-width:0}
.image-preview{margin-top:.6rem;border-radius:12px;overflow:hidden;background:linear-gradient(180deg,#fff,#fbfdff);border:1px solid rgba(15,23,42,0.04);width:100%;max-width:100%;display:none;padding:.75rem;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:.75rem}
.image-preview.show{display:grid}
.image-preview-item{position:relative;border-radius:12px;overflow:hidden;background:#f8fafc;border:1px solid rgba(15,23,42,.06);min-height:110px}
.image-preview-item img{width:100%;height:110px;object-fit:cover;display:block}
.image-preview-badge{position:absolute;left:.45rem;bottom:.45rem;background:rgba(15,23,42,.78);color:#fff;padding:.18rem .4rem;border-radius:999px;font-size:.72rem;font-weight:700}
.image-preview-remove{position:absolute;top:.45rem;right:.45rem;width:28px;min-width:28px;max-width:28px;height:28px;min-height:28px;max-height:28px;padding:0;border:none;border-radius:999px;background:rgba(15,23,42,.82);color:#fff;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1;flex:0 0 28px;aspect-ratio:1 / 1}
.image-preview-remove:hover{background:#dc2626}
.product-title{font-weight:800;font-size:1.1rem;line-height:1.2}
.product-desc{color:var(--muted);font-size:.95rem;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.product-foot{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:1.25rem;border-left:1px solid rgba(15,23,42,0.06);gap:1rem}
.product-price{font-size:1.15rem;font-weight:800;color:#0f172a}
.product-actions{display:flex;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.product-actions .btn-small{padding:.45rem .6rem}

.admin-form .grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.admin-form .field{display:flex;flex-direction:column}
.admin-form .field label{font-weight:700;margin-bottom:.35rem;color:var(--muted)}
.field-help{margin-top:.45rem;font-size:.85rem;color:var(--muted)}
.admin-form input,.admin-form textarea{width:100%;max-width:100%;min-width:0;padding:.6rem .8rem;border-radius:10px;border:1px solid rgba(15,23,42,0.06)}
.admin-form textarea{min-height:120px}
.actions{display:flex;gap:.5rem;justify-content:flex-end;margin-top:.75rem}

/* Buttons */
.btn-primary{background:linear-gradient(180deg,#0b89ff,#0666d6);color:#fff;padding:.55rem .85rem;border-radius:10px;border:none;font-weight:800;cursor:pointer}
.btn-primary.small{padding:.45rem .65rem;font-size:.95rem}
.btn-ghost{background:transparent;border:1px solid rgba(15,23,42,0.06);padding:.5rem .7rem;border-radius:8px}

@media (max-width: 880px) {
	/* Improved mobile admin layout: stack sections, full-width panels, vertical sidebar */
	.admin-shell { max-width: 100%; margin: .75rem; }
	.admin-body { display: flex; flex-direction: column; gap: .75rem; }
	.admin-grid { display: block; }

	/* Sidebar becomes full-width vertical block */
	.sidebar { order: 0; width: 100%; display: block; padding: .75rem; border-radius: 10px; }
	.sidebar-nav { flex: none; }
	.sidebar-nav ul { display: block; padding: 0; margin: 0; }
	.sidebar-nav ul li { margin-bottom: .5rem; }
	.sidebar-nav ul li a { display: block; padding: .65rem .6rem; border-radius: 8px; }
	.sidebar-footer { display: none; }

	/* Topbar and header compact layout */
	.admin-topbar { padding: .75rem; border-radius: 10px; margin-bottom: .5rem; flex-direction: column; align-items: stretch; gap: .75rem; }
	.admin-topbar .brand { align-items: center; }
	.topbar-actions { gap: .5rem; flex-direction: column; align-items: stretch; }
	#userEmail { width: 100%; overflow-wrap: anywhere; }
	#logoutBtn { width: 100%; }

	/* Content header stacks actions and search stretches full width */
	.content-header { display: flex; flex-direction: column; align-items: stretch; gap: .6rem; }
	.content-actions { width: 100%; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: space-between; }
	#adminSearch { width: 100%; min-width: 0; }

	/* Product list tweaks for tablet */
	.products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
	.products-list { gap: .85rem; }
	.product-card { grid-template-columns: 150px minmax(0,1fr); min-height: 150px; }
	.product-media { height: 150px; min-height: 150px; }
	.product-foot { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; border-left: 0; border-top: 1px solid rgba(15,23,42,0.06); }
	.product-actions { justify-content: flex-end; }

	.panel-inner { padding: .85rem; }
	.admin-form .grid-2 { grid-template-columns: 1fr; gap: .85rem; }
	#productForm, .admin-form, .admin-form .field { width: 100%; min-width: 0; }
	.image-preview { max-width: 100%; }

	/* Order: main content first, admin panel (sidebar tools) after */
	.admin-main { order: 1; }
	.admin-panel { order: 2; }
}

@media (max-width: 520px) {
	/* Mobile: make nav wrap, stack actions vertically */
	.admin-shell { margin: .5rem; }
	.sidebar-nav ul { flex-wrap: wrap; }
	.content-actions { flex-direction: column; align-items: stretch; }
	.btn-primary.small { width: 100%; }
	.products-grid { grid-template-columns: 1fr; }
	.products-list { gap: .75rem; }
	.product-card { grid-template-columns: 1fr; }
	.card-media, .product-media { height: 150px; min-height: 150px; }
	.product-foot { grid-column: auto; flex-direction: column; align-items: stretch; }
	.product-actions { justify-content: stretch; }
	.product-actions .btn-small { flex: 1 1 auto; text-align: center; margin-right: 0; }
	.image-preview-item img { height: 140px; }
	.panel-inner { padding: .75rem; }
	.admin-topbar .brand { align-items: flex-start; }
	.logo { width: 40px; height: 40px; }
	.actions { flex-direction: column; align-items: stretch; }
	.actions .btn-primary,
	.actions .btn-ghost,
	#productForm button { width: 100%; }
	#productForm .image-preview-remove { width: 28px; min-width: 28px; max-width: 28px; }
}

/* product form */
.admin-section h3{margin:0 0 .75rem}
#productForm{display:flex;flex-direction:column;gap:.6rem}
#productForm label{display:flex;flex-direction:column;font-size:.95rem;color:var(--muted)}
#productForm input,#productForm textarea{margin-top:.4rem;padding:.6rem .8rem;border-radius:10px;border:1px solid rgba(15,23,42,0.06)}
#productForm button{align-self:flex-start;background:#10b981;color:#fff;padding:.5rem .85rem;border-radius:8px;border:none;font-weight:700;cursor:pointer}
#productForm button:hover{filter:brightness(.98);transform:translateY(-2px)}

/* ADMIN LIST */
.admin-list{margin-top:1.25rem}
.admin-table{display:flex;flex-direction:column;gap:.6rem}
.admin-row{display:grid;grid-template-columns:2fr 4fr 1fr;gap:1rem;padding:.9rem;border-radius:10px;background:var(--card);align-items:center;border:1px solid rgba(15,23,42,0.04)}
.admin-row .title{font-weight:700;color:var(--accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.admin-row .desc{color:var(--muted);font-size:.95rem;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.admin-row .price{text-align:right;font-weight:700;color:#0f172a}
.admin-row:hover{transform:translateY(-4px);box-shadow:0 20px 45px rgba(15,23,42,0.08)}
.muted{color:var(--muted)}

/* responsive adjustments */
@media(max-width:1000px){.admin-row{grid-template-columns:1fr 2fr 1fr}}
@media(max-width:640px){.admin-row{grid-template-columns:1fr;row-gap:.6rem}.admin-row .price{text-align:left}}

@media(max-width:880px){.admin-grid{grid-template-columns:1fr}.admin-panel{order:2}.admin-main{order:1}}

/* thumbnails */
.thumb{width:48px;height:48px;border-radius:8px;overflow:hidden;margin-right:.6rem;flex:0 0 48px}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.thumb-placeholder{width:48px;height:48px;background:linear-gradient(135deg,#eef2ff,#f0fdf4);border-radius:8px}
.admin-row .title{display:flex;align-items:center}

/* tiny action buttons */
.btn-small{padding:.35rem .6rem;border-radius:8px;border:1px solid rgba(15,23,42,0.06);background:transparent;cursor:pointer;margin-right:.4rem}
.btn-small:hover{transform:translateY(-2px)}
.btn-small.danger{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.btn-small.muted{background:transparent;color:var(--muted)}
.btn-small.sold{background:#ecfdf3;border-color:#bbf7d0;color:#166534}
.btn-small.sold[disabled]{background:#dcfce7;border-color:#bbf7d0;color:#166534;cursor:default;opacity:1}
.btn-small.sold[disabled]:hover{transform:none}


