:root{--ink:#15233b;--muted:#62728b;--line:#e4eaf2;--accent:#1565dc;--bg:#f5f7fb}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:var(--ink);background:var(--bg)}a{color:inherit;text-decoration:none}.wrap{width:min(1180px,calc(100% - 32px));margin:auto}.top{background:#fff;border-bottom:1px solid var(--line)}.topin{display:flex;align-items:center;justify-content:space-between;padding:18px 0}.logo{font-weight:900;letter-spacing:-1.5px;font-size:29px}.logo span{color:var(--accent)}.toplink{font-size:14px;color:var(--muted)}h1{font-size:clamp(27px,4vw,40px);letter-spacing:-1px;margin:32px 0 9px}.intro{color:var(--muted);margin:0 0 26px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:25px 0 45px}.brand,.product,.panel{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 5px 24px #15233b08}.brand{transition:transform .15s,box-shadow .15s}.brand:hover{transform:translateY(-3px);box-shadow:0 12px 28px #15233b16}.brand img{width:100%;height:190px;object-fit:contain;background:white;padding:13px}.brandbody{padding:16px;border-top:1px solid var(--line)}.brandname{font-weight:800;font-size:19px}.small,.meta{font-size:13px;color:var(--muted)}.product{padding:20px;margin:15px 0;display:grid;grid-template-columns:180px 1fr;gap:23px}.product>img{width:100%;aspect-ratio:1;object-fit:contain}.product h2{font-size:19px;margin:0 0 10px}.product p{line-height:1.6;color:#526078;margin:7px 0}.price{font-size:25px;font-weight:800;margin:10px 0}.metrics{display:flex;gap:16px;flex-wrap:wrap;font-size:13px;color:var(--muted)}.metrics strong{color:var(--ink)}.actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:13px}.btn,button{display:inline-block;border:0;border-radius:9px;padding:11px 17px;background:var(--accent);color:#fff;font-weight:700;cursor:pointer;font-size:14px}.btn:hover,button:hover{filter:brightness(.9)}.chartwrap{margin-top:17px;border-top:1px solid var(--line);padding-top:14px}.chartwrap summary{cursor:pointer;color:var(--accent);font-weight:650;font-size:14px}.chart{width:100%;height:155px;display:block;margin-top:10px}.pagination{display:flex;gap:8px;flex-wrap:wrap;margin:25px 0 50px}.pagination a,.pagination strong{padding:9px 13px;border-radius:8px;background:#fff;border:1px solid var(--line)}.pagination strong{background:var(--accent);color:white}.panel{padding:25px;margin:25px 0}input[type=text],input[type=password],input[type=file]{display:block;width:100%;max-width:550px;padding:12px;margin:8px 0 15px;border:1px solid #ccd6e3;border-radius:9px;background:#fff}.alert{padding:14px;border-radius:9px;background:#eaf4ff;margin:12px 0;white-space:pre-wrap}.bad{background:#fff0ed}footer{padding:35px 0;color:var(--muted);font-size:13px}table{border-collapse:collapse;width:100%}td,th{padding:11px;border-bottom:1px solid var(--line);text-align:left}th{font-size:13px;color:var(--muted)}@media(max-width:900px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:620px){.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.brand img{height:140px}.brandbody{padding:12px}.brandname{font-size:16px}.product{grid-template-columns:100px 1fr;gap:12px;padding:13px}.product h2{font-size:16px}.product p{font-size:13px}.price{font-size:21px}.chartwrap{grid-column:1/-1}}

/* v1.2: búsqueda y enlace Amazon */
.topright{display:flex;align-items:center;gap:18px}.header-search{display:flex;gap:6px;align-items:center}.header-search input{width:min(310px,38vw);padding:10px 12px;border:1px solid var(--line);border-radius:9px;font:inherit;background:white}.header-search button{border:0;border-radius:9px;background:var(--accent);color:white;padding:10px 14px;font:inherit;cursor:pointer}.actions{display:flex;gap:10px;flex-wrap:wrap}.btn-amazon{background:#232f3e!important;color:#fff!important}.search-brands{margin:20px 0 28px}.brand-tags{display:flex;flex-wrap:wrap;gap:10px}.brand-tags a{padding:10px 15px;border-radius:10px;background:white;border:1px solid var(--line);font-weight:650}.brand-tags a:hover{border-color:var(--accent)}@media(max-width:700px){.topin{flex-wrap:wrap;gap:12px}.topright{width:100%;flex-wrap:wrap;gap:10px}.header-search{width:100%;order:2}.header-search input{width:100%;min-width:0;flex:1}.toplink{margin-left:auto}}

/* v1.4: las miniaturas nunca fuerzan la altura de la tarjeta */
.product{grid-template-columns:180px minmax(0,1fr);align-items:start;min-height:0}
.product>img{display:block;width:180px!important;height:180px!important;max-width:100%;max-height:180px;aspect-ratio:1/1;object-fit:contain;object-position:center;align-self:start;background:#fff}
.product>div{min-width:0}
@media(max-width:620px){.product{grid-template-columns:100px minmax(0,1fr)}.product>img{width:100px!important;height:100px!important;max-height:100px}}

/* v1.5 - buscador visible y tarjetas compactas */
.topright{display:flex;align-items:center;gap:18px}.header-search{display:flex;align-items:center;gap:7px;margin:0}.header-search input[type=search]{width:min(330px,38vw);height:42px;border:1px solid var(--line);border-radius:9px;padding:0 13px;font:inherit;background:#fff;min-width:0}.header-search button{height:42px;padding:0 17px;white-space:nowrap}.product{align-items:start}.product>img{display:block;max-width:180px;max-height:180px;height:180px;object-fit:contain;align-self:start}.product p{line-height:1.55}.product .meta{margin-bottom:6px}.brand-tags{display:flex;flex-wrap:wrap;gap:10px}.brand-tags a{display:inline-block;padding:10px 14px;background:white;border:1px solid var(--line);border-radius:9px}.search-brands{margin:20px 0}.search-brands h2{font-size:20px}
@media(max-width:700px){.topin{flex-wrap:wrap;gap:12px}.topright{width:100%;display:flex;flex-wrap:wrap;gap:10px}.header-search{order:2;width:100%}.header-search input[type=search]{flex:1;width:100%}.toplink{margin-left:auto}.product>img{max-width:100px;max-height:100px;height:100px}}

/* v1.7 Branding & footer */
.top .logo{display:flex;align-items:center;flex-shrink:0}.top .logo img{display:block;width:220px;height:auto;max-height:62px}.site-footer{margin-top:65px;background:#111d2c;color:#d5deec;padding:55px 0 22px}.site-footer .footer-grid{display:grid;grid-template-columns:2.1fr 1fr 1fr 1fr;gap:38px}.site-footer .footer-brand img{display:block;width:min(260px,100%);height:auto;background:white;border-radius:10px;padding:6px}.site-footer .footer-brand p{line-height:1.7;max-width:350px;color:#bbc7d9}.site-footer h2{font-size:15px;color:#fff;text-transform:uppercase;letter-spacing:.06em;margin:0 0 21px;padding-bottom:14px;position:relative}.site-footer h2:after{content:"";position:absolute;bottom:0;left:0;width:38px;height:3px;background:#1687ff}.site-footer nav{display:flex;flex-direction:column;align-items:flex-start;gap:13px}.site-footer nav a{font-size:14px;color:#c5d0e0}.site-footer nav a:hover{color:#fff;text-decoration:underline}.site-footer .footer-bottom{border-top:1px solid #334255;margin-top:38px;padding-top:22px;display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;font-size:13px;color:#aebdd0}.info-page{max-width:850px;margin:0 auto;min-height:38vh}.info-page .panel{line-height:1.8}.info-page p{margin:0}
@media(max-width:950px){.site-footer .footer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:570px){.top .logo img{width:190px}.site-footer{padding-top:40px}.site-footer .footer-grid{grid-template-columns:1fr;gap:30px}.site-footer .footer-bottom{flex-direction:column}}

.delete-product-form{margin-top:12px}.delete-product-btn{border:1px solid #b91c1c;background:#fff1f2;color:#991b1b;padding:9px 14px;border-radius:9px;font-weight:700;cursor:pointer}.delete-product-btn:hover{background:#fee2e2}

/* v2.3: el texto rodea la miniatura en móvil y aprovecha el ancho completo debajo */
@media(max-width:620px){
 .product{display:block;min-height:0}
 .product::after{content:"";display:block;clear:both}
 .product>img{float:left;display:block;width:100px!important;height:100px!important;max-width:100px;margin:0 13px 7px 0;object-fit:contain}
 .product>div{display:block;min-width:0}
 .product h2{margin-top:0}
 .product p{margin-top:7px;overflow-wrap:anywhere}
 .delete-product-form{clear:both;padding-top:8px}
}

/* v2.7: botón por producto y diálogo de tiendas */
.product-shop-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;border:0;border-radius:10px;background:#1458c5;color:#fff;padding:11px 17px;margin-top:10px;font:inherit;font-weight:750;cursor:pointer;box-shadow:0 3px 10px rgba(20,88,197,.16);transition:background .2s,transform .2s}
.product-shop-button:hover{background:#0c4299;transform:translateY(-1px)}.product-shop-button:focus-visible,.shop-close:focus-visible,.shop-choice:focus-visible{outline:3px solid #f9ac3c;outline-offset:3px}
.shop-modal[hidden]{display:none!important}.shop-modal{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:18px}.shop-modal-backdrop{position:absolute;inset:0;background:rgba(12,25,45,.68);backdrop-filter:blur(4px)}
.shop-dialog{position:relative;width:min(100%,470px);max-height:calc(100dvh - 36px);overflow:auto;border-radius:22px;background:#fff;padding:30px 26px 25px;text-align:center;box-shadow:0 22px 75px rgba(0,0,0,.25)}
.shop-close{position:absolute;right:13px;top:12px;display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:50%;background:#f0f3f8;color:#243047;font-size:27px;cursor:pointer}
.shop-dialog-icon{font-size:36px}.shop-dialog h2{font-size:24px;margin:12px 0 10px;color:#10213b}.shop-modal-product{font-size:14px;font-weight:700;line-height:1.45;color:#314563;margin:0 0 12px;overflow-wrap:anywhere}.shop-dialog-help{color:#66758d;font-size:14px;margin:0 0 20px}.shop-modal-links{display:grid;gap:12px}
.shop-choice{display:flex;justify-content:center;align-items:center;gap:12px;padding:15px;border-radius:12px;color:#fff!important;font-weight:800;text-decoration:none!important;transition:filter .15s,transform .15s}.shop-choice:hover{filter:brightness(.93);transform:translateY(-1px)}.shop-choice-mm{background:#d71920}.shop-choice-amz{background:#232f3e}.shop-disclaimer{font-size:12px;color:#66758d;line-height:1.5;margin:18px 0 0}
body.shop-modal-open{overflow:hidden}
@media(max-width:620px){.product-shop-button{clear:both;display:flex;width:100%;margin-top:12px}.shop-dialog{padding:26px 19px 20px}.shop-dialog h2{font-size:21px}}

/* Formulario de contacto */
.contact-form{max-width:700px;margin:22px 0 35px;background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:clamp(18px,3vw,32px);display:flex;flex-direction:column;gap:11px;box-shadow:0 10px 28px rgba(20,38,72,.05)}
.contact-form>label:not(.contact-consent){font-weight:700;color:#13233d;margin-top:8px}
.contact-form>input,.contact-form>textarea{font:inherit;color:#17233b;border:1px solid #cbd5e1;border-radius:10px;padding:13px 14px;width:100%;box-sizing:border-box;background:#fff}
.contact-form>input:focus,.contact-form>textarea:focus{outline:2px solid #3b82f6;outline-offset:1px}
.contact-consent{display:flex;align-items:flex-start;gap:10px;font-size:.94rem;line-height:1.5;margin-top:8px}
.contact-consent input{margin-top:5px;flex:none}.contact-consent a{color:#1458c5}
.contact-form button{border:0;border-radius:11px;background:#1458c5;color:white;font:inherit;font-weight:750;padding:15px 20px;cursor:pointer;margin-top:10px}.contact-form button:hover{background:#0f459e}
.contact-help{font-size:.88rem;color:#66748a;margin:2px 0}.contact-trap{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
.contact-notice{padding:14px 18px;border-radius:10px;margin-top:18px}.contact-success{background:#ecfdf5;color:#065f46}.contact-error{background:#fff1f2;color:#9f1239}

/* Administración de marcas */
.brand-admin-list{display:grid;gap:8px;max-height:680px;overflow:auto}.brand-admin-item{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px;border:1px solid #e3e8ef;border-radius:12px}.brand-admin-item form{margin:0}.brand-admin-item button{white-space:nowrap}.brand-admin-off{background:#fff!important;color:#a42d38!important;border:1px solid #e6b7bd!important}.brand-admin-on{background:#146b48!important;color:#fff!important}

/* Popularidad basada exclusivamente en entradas desde Google */
.popularity{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:8px 0;color:#334155;font-size:12px;line-height:1.5}.popularity strong{font-size:14px;color:#10213b}.pop-stars{white-space:nowrap;letter-spacing:1px}.pop-star{color:#cbd5e1;font-size:17px}.pop-star.is-on{color:#f59e0b}.pop-label{color:#64748b}.popularity-empty{color:#64748b;font-size:12px} .brand .popularity{margin:7px 0}

/* Popularidad visible también en la cabecera de cada marca */
.brand-page-popularity{margin:8px 0 14px;padding:10px 14px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;display:inline-block;max-width:100%}.brand-page-popularity .popularity{margin:0;font-size:14px}.brand-page-popularity .pop-star{font-size:20px}.brand-page-popularity .popularity strong{font-size:17px}

/* v3.5: ventana de tiendas con fotografía y composición premium */
.shop-dialog{width:min(100%,890px);padding:34px 36px 26px;text-align:left;border-radius:24px;box-shadow:0 30px 90px rgba(6,18,40,.36)}
.shop-dialog-main{display:grid;grid-template-columns:minmax(0, .95fr) minmax(0,1.75fr);align-items:center;gap:35px}
.shop-product-image{height:340px;display:flex;align-items:center;justify-content:center;background:linear-gradient(150deg,#f7f9fd,#fff);border:1px solid #e7ebf3;border-radius:18px;box-shadow:0 8px 22px rgba(15,30,60,.05);overflow:hidden}
.shop-product-image img{width:100%;height:100%;object-fit:contain;padding:18px;box-sizing:border-box}
.shop-dialog-icon{display:inline-flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:50%;background:#e4f7ee;font-size:27px}
.shop-dialog h2{font-size:clamp(22px,2.4vw,29px);line-height:1.2;margin:14px 0 9px}
.shop-modal-product{font-size:16px;margin-bottom:15px}.shop-dialog-help{margin-bottom:18px}
.shop-modal-links{gap:10px}.shop-choice{justify-content:space-between;min-height:70px;padding:9px 16px;box-sizing:border-box;border-radius:13px;box-shadow:0 4px 14px rgba(10,20,40,.09)}
.shop-choice-amz{background:linear-gradient(110deg,#ffac0c,#fa8800)}.shop-choice-mm{background:linear-gradient(110deg,#ec171d,#d90008)}
.shop-store-logo{display:flex;align-items:center;justify-content:center;position:relative;flex:0 0 145px;font-weight:900;font-size:24px;letter-spacing:-1.2px;white-space:nowrap}
.amazon-logo{color:#111;background:#fff;border-radius:10px;height:50px;font-family:Arial,sans-serif;font-size:28px;padding-bottom:8px;box-sizing:border-box}.amazon-smile{position:absolute;color:#ff9900;bottom:0;left:62px;font-size:27px;line-height:12px;transform:rotate(-7deg)}
.mediamarkt-logo{font-size:21px;font-style:italic;letter-spacing:-1.4px}
.shop-choice-label{font-size:14px;font-weight:800;flex:1;text-align:center;border-left:1px solid rgba(255,255,255,.35);padding-left:12px}
.shop-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;background:#f3f6fb;border-radius:14px;margin-top:26px;padding:17px 10px;text-align:center;color:#34445e;font-size:12px;font-weight:600}
.shop-benefits span{padding:0 12px}.shop-benefits span+span{border-left:1px solid #dce3ef}
.shop-disclaimer{text-align:center;margin:22px 0 0}
@media(max-width:720px){.shop-dialog{padding:25px 18px 20px}.shop-dialog-main{grid-template-columns:1fr;gap:12px}.shop-product-image{height:170px}.shop-product-image img{padding:8px}.shop-dialog-content{text-align:center}.shop-dialog-icon{width:42px;height:42px;font-size:23px}.shop-dialog h2{font-size:22px;margin:8px 0}.shop-modal-product{font-size:14px;margin-bottom:8px}.shop-dialog-help{margin-bottom:12px}.shop-choice{min-height:58px}.shop-store-logo{flex-basis:115px;font-size:18px}.amazon-logo{height:42px;font-size:23px}.amazon-smile{left:50px}.shop-choice-label{font-size:12px}.shop-benefits{margin-top:15px;padding:12px 5px;font-size:10px}.shop-benefits span{padding:0 5px}.shop-disclaimer{margin-top:12px}}
@media(max-width:390px){.shop-choice-label{font-size:11px}.shop-store-logo{flex-basis:100px}.mediamarkt-logo{font-size:16px}}

/* v3.6: composición horizontal real y caché renovada */
@media(min-width:721px){
 .shop-modal{padding:24px!important}
 .shop-dialog{width:min(920px,calc(100vw - 48px))!important;max-width:none!important;padding:34px 36px 27px!important;text-align:left!important}
 .shop-dialog-main{display:grid!important;grid-template-columns:minmax(0,275px) minmax(0,1fr)!important;gap:36px!important;align-items:center!important}
 .shop-product-image{height:340px!important;min-width:0!important}
 .shop-dialog-content{text-align:left!important;min-width:0!important}
 .shop-modal-links{display:grid!important;gap:12px!important}
 .shop-choice{min-height:76px!important}
}
.shop-modal{isolation:isolate}.shop-dialog{box-sizing:border-box!important}
.shop-dialog-icon{background:#e4f7ee!important;color:#18a96c!important;font-size:26px!important;font-weight:900!important}
.shop-store-logo{min-width:0}.shop-store-logo img{display:block;max-width:100%;height:auto;max-height:44px;object-fit:contain}
.amazon-logo{background:#fff!important;padding:5px 10px!important;height:52px!important;border-radius:9px!important}
.mediamarkt-logo{font-style:normal!important;letter-spacing:normal!important}
.shop-choice-label{font-size:14px!important;line-height:1.25!important}
.shop-benefits{align-items:center!important;line-height:1.5!important}
@media(max-width:720px){
 .shop-modal{padding:12px!important}
 .shop-dialog{width:min(100%,480px)!important;max-width:none!important;padding:18px 16px 20px!important}
 .shop-dialog-main{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
 .shop-product-image{height:155px!important;width:100%!important}
 .shop-product-image img{padding:8px!important}
 .shop-dialog h2{font-size:21px!important}
 .shop-choice{min-height:62px!important;padding:7px 10px!important;gap:7px!important}
 .shop-store-logo{flex:0 0 116px!important}.shop-store-logo img{max-height:34px!important}
 .amazon-logo{height:42px!important}.shop-choice-label{font-size:12px!important;padding-left:6px!important}
 .shop-benefits{grid-template-columns:1fr!important;gap:6px!important;padding:10px!important;text-align:left!important}
 .shop-benefits span{border:0!important;padding:0 8px!important}
 .shop-disclaimer{font-size:11px!important}
}
