
:root{--bg:#f5f5f3;--card:#fff;--text:#111;--muted:#777;--line:#e5e5e2;--accent:#111;--danger:#c62828}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;padding-bottom:88px}
button,input,select,textarea{font:inherit}.hidden{display:none!important}
.top{display:grid;grid-template-columns:minmax(0,1fr) 56px;align-items:center;padding:8px 14px 6px;position:sticky;top:0;background:rgba(245,245,243,.96);backdrop-filter:blur(18px);z-index:5}
.brand-wrap{display:flex;align-items:center;min-height:58px}.brand-mark{width:82px;height:58px;object-fit:contain;object-position:left center;display:block}
.cart-button{grid-column:3;position:relative;justify-self:end;width:50px;height:50px;border:1px solid var(--line);border-radius:16px;background:#fff;color:#111;display:grid;place-items:center;padding:0}
.cart-button svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.cart-count{position:absolute;right:-4px;top:-4px;min-width:20px;height:20px;border-radius:999px;background:#111;color:#fff;font-size:11px;font-weight:800;display:grid;place-items:center;padding:0 5px}
main{padding:8px 14px}.search,input,select,textarea{width:100%;border:1px solid var(--line);background:#fff;border-radius:14px;padding:13px;font-size:16px;color:#111}.search{border-radius:16px;padding:14px 15px}
.categories{display:flex;gap:8px;overflow-x:auto;padding:10px 0 14px;scrollbar-width:none}.categories::-webkit-scrollbar{display:none}.category-btn{flex:0 0 auto;white-space:nowrap;border:1px solid var(--line);border-radius:999px;background:#fff;color:#111;padding:10px 14px;font-size:14px;font-weight:750}.category-btn.active{background:#111;color:#fff;border-color:#111}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.card{background:#fff;border-radius:17px;overflow:hidden;border:1px solid var(--line)}.card img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:#eee}.card-body{padding:10px 11px 12px}.article{font-size:12px;color:var(--muted);font-weight:800}.name{font-size:15px;font-weight:800;margin-top:3px;line-height:1.18;min-height:35px}.price{font-size:17px;font-weight:900;margin-top:8px}
button{border:0;border-radius:12px;background:#111;color:white;padding:12px 14px;font-size:15px;font-weight:750}.ghost{background:#e9e9e6!important;color:#111!important}.danger{background:#fee8e8!important;color:var(--danger)!important}.wide{width:100%;margin-top:10px}
.tabs{position:fixed;bottom:0;left:0;right:0;background:rgba(255,255,255,.96);backdrop-filter:blur(18px);padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:flex;gap:8px;border-top:1px solid var(--line);z-index:7}.tabs button{flex:1;background:#ececea;color:#111;border-radius:16px}.tabs .active{background:#111;color:#fff}
.panel{background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px;margin-bottom:14px}.panel input,.panel textarea,.panel select,.file{margin-top:8px}.file{display:block;border:1px dashed #bbb;border-radius:14px;padding:12px}.file input{border:0;padding:8px 0 0}.row{display:flex;gap:8px}.row>*{flex:1}
dialog{border:0;border-radius:22px;width:min(94vw,560px);padding:16px}dialog::backdrop{background:rgba(0,0,0,.55)}.dialog-head{display:flex;align-items:center;justify-content:space-between}.dialog-head h2{margin:0}.close-x{width:38px;height:38px;border-radius:50%;padding:0;background:#ececea;color:#111;font-size:25px;font-weight:500}
.detail-img{width:100%;border-radius:15px;aspect-ratio:1/1;object-fit:cover;background:#eee}.detail h2{margin:12px 0 4px}.desc{white-space:pre-wrap;color:#333}.qty{display:grid;grid-template-columns:48px 1fr 48px;gap:8px;align-items:center;margin:14px 0}.qty input{text-align:center}
.cart-item{display:grid;grid-template-columns:minmax(0,1fr) 82px;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.cart-title{font-size:17px;font-weight:850}.cart-meta,.cart-comment{margin-top:5px;color:var(--muted);font-size:14px}.cart-thumb{width:82px;height:82px;object-fit:cover;border-radius:13px;background:#eee;border:1px solid var(--line)}.cart-actions{display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap}.cart-actions button{padding:8px 10px}.total{text-align:right;font-size:19px;margin-top:15px}
.section-title h2{font-size:30px;margin:8px 0 14px}.admin-menu{display:grid;gap:10px}.admin-menu button{padding:17px;text-align:left;font-size:18px;background:#fff;color:#111;border:1px solid var(--line)}.page-head{display:grid;grid-template-columns:48px 1fr auto;align-items:center;gap:8px;margin-bottom:12px}.page-head h2{margin:0;font-size:27px}.backAdmin{width:44px;height:44px;padding:0}.admin-toolbar{display:grid;grid-template-columns:1fr 150px;gap:8px}.admin-list{display:grid;gap:8px}.admin-item{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px}.admin-item-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start}.status{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:12px;font-weight:800;margin-top:6px;background:#eef6ee}.status.hiddenStatus{background:#eee}.admin-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.admin-actions button{padding:9px 10px;font-size:14px}.toast{position:fixed;top:16px;left:50%;transform:translateX(-50%) translateY(-20px);opacity:0;pointer-events:none;background:#111;color:#fff;border-radius:12px;padding:11px 14px;z-index:50;font-weight:750;transition:.2s;max-width:88vw;text-align:center}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.empty{text-align:center;color:var(--muted);padding:40px}
@media(max-width:360px){.brand-logo{height:62px}.search{font-size:15px}.category-btn{font-size:13px;padding:9px 12px}.admin-toolbar{grid-template-columns:1fr}}
@media(min-width:700px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

.order-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:13px}
.order-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.order-head h3{margin:0}
.order-meta{font-size:13px;color:var(--muted);margin-top:3px}.order-status{border-radius:999px;padding:6px 9px;font-size:12px;font-weight:800;background:#eee}
.order-items{display:grid;gap:8px;margin-top:12px}.order-item{display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:10px;align-items:start;border-top:1px solid var(--line);padding-top:9px}
.order-item img{width:72px;height:72px;object-fit:cover;border-radius:12px}.order-item-title{font-weight:800}
.order-item-meta,.order-item-comment{font-size:13px;color:var(--muted);margin-top:4px}.order-total{text-align:right;font-size:18px;font-weight:900;margin-top:12px}
.status-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.status-actions button{padding:8px 10px;font-size:13px}

/* V6 header */
.top{display:block;padding:18px 14px 10px;position:sticky;top:0;background:rgba(245,245,243,.96);backdrop-filter:blur(18px);z-index:5}
.brand-wrap{display:block;min-height:0}
.brand-title{font-size:30px;font-weight:900;line-height:1;letter-spacing:.03em;color:#111}
.brand-subtitle{margin-top:6px;font-size:15px;line-height:1.25;color:#777}
.catalog-head{display:flex;align-items:center;justify-content:space-between;margin:4px 0 14px}
.catalog-head h2{margin:0;font-size:24px;line-height:1.1}
.catalog-head .cart-button{grid-column:auto;justify-self:auto;flex:0 0 auto}

/* V7 caret */
input, textarea { caret-color:#007aff; }
/* V7 GALLERY FRONTEND */
.detail-gallery{margin-bottom:14px}
.detail-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;border-radius:16px}
.detail-track::-webkit-scrollbar{display:none}
.detail-slide{flex:0 0 100%;width:100%;aspect-ratio:1/1;object-fit:contain;scroll-snap-align:start;background:#fff;display:block}
.gallery-dots{display:flex;justify-content:center;align-items:center;gap:7px;padding:9px 0 2px}
.gallery-dot{width:7px;height:7px;border:0;border-radius:50%;padding:0;background:#c8c8c8}
.gallery-dot.active{background:#111;transform:scale(1.25)}
.v7-gallery-admin{margin:14px 0;padding:12px;border:1px solid var(--line);border-radius:16px;background:#fff}
.v7-gallery-list{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0}
.v7-gallery-item img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:10px;display:block}

/* BAD GRINGO admin refinement */
.category-admin-main{display:flex;align-items:center;justify-content:space-between;gap:12px}
.category-move{display:flex;gap:7px}
.category-move button{min-width:43px;font-size:20px;padding:7px 11px}
.category-move button:disabled{opacity:.3}
.cart-category-separator{height:12px;background:#eeeeec;border-radius:3px;margin:10px 0}
.status-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.status-actions .order-status-choice{background:#f0f0ee;color:#111;border:1.5px solid #e0e0dd;font-weight:650;padding:11px 8px}
.status-actions .order-status-choice.selected{background:#e6e6e3;border:2px solid #111;color:#111;font-weight:850}
.order-bottom-actions{justify-content:space-between;border-top:1px solid var(--line);padding-top:12px;margin-top:14px}
.order-meta{line-height:1.55;overflow-wrap:anywhere}

.product-size{font-size:13px;color:#777;margin:4px 0;line-height:1.4}

/* Product detail: action, comment, then description */
.detail #addCart{margin-top:8px}
.detail #comment{display:block;margin-top:12px;min-height:88px}
.detail .desc{margin:16px 0 4px;line-height:1.5}

/* BAD GRINGO product dialog V9 */
#productDialog{position:relative;max-height:calc(100dvh - 36px);overflow-y:auto;padding-top:56px}
#productDialog .product-close{position:absolute;top:12px;left:16px;z-index:2}
#productDialog .purchase-row{display:grid;grid-template-columns:38px minmax(40px,65px) 38px minmax(0,1fr);align-items:center;gap:6px;margin:14px 0}
#productDialog .purchase-row button{padding:11px 5px;min-height:46px}
#productDialog .purchase-row input{min-width:0;width:100%;text-align:center;padding:10px 2px;min-height:46px}
#productDialog .purchase-row #addCart{font-size:13px;line-height:1.15;padding:9px 5px}
#productDialog #comment{min-height:90px;resize:vertical}
#productDialog .desc{margin-top:16px}

/* Final V10: compact controls, top-left close, scroll-safe modal */
#productDialog { position:relative; padding-top:54px; max-height:calc(100dvh - 24px); overflow-y:auto; }
#productDialog .product-close { position:absolute; top:12px; left:16px; margin:0; z-index:10; width:36px; height:36px; min-width:36px; border-radius:50%; background:#111; color:white; display:flex; align-items:center; justify-content:center; }
#productDialog .purchase-row { display:grid; grid-template-columns:36px minmax(42px,60px) 36px minmax(0,1fr); gap:6px; align-items:stretch; width:100%; margin:14px 0; }
#productDialog .purchase-row button { min-width:0; width:100%; min-height:44px; }
#productDialog .purchase-row input { min-width:0; width:100%; text-align:center; }
#productDialog .purchase-row #addCart { font-size:clamp(11px,3vw,14px); white-space:normal; line-height:1.1; padding:6px 3px; }
#productDialog #comment { display:block; width:100%; margin:12px 0; }
#productDialog .desc { margin:16px 0 4px; }

#productDialog .product-close { left: auto !important; right: 16px !important; }
#productDialog { position:fixed !important; top:50% !important; left:50% !important; right:auto !important; bottom:auto !important; transform:translate(-50%,-50%) !important; margin:0 !important; max-height:calc(100dvh - 30px) !important; overflow-y:auto !important; }
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.top .brand-wrap{min-width:0;}
.top #cartBtn{flex:0 0 auto;margin-left:auto;}
.catalog-tools-sticky{position:sticky;top:0;z-index:20;background:#fff;padding:10px 0 8px;}
.catalog-head{position:sticky;top:0;z-index:31;background:#fff;padding:8px 0;}
.catalog-tools-sticky{top:64px !important;z-index:30;}
.top{position:sticky;top:0;z-index:40;background:#fff;padding:10px 0;}
.catalog-tools-sticky{position:sticky;top:74px !important;z-index:39;background:#fff;padding:8px 0 8px !important;}
 html,body,main,#catalog{background:#fff !important;}
 .top{background:#fff !important;padding:12px 22px !important;box-sizing:border-box;}
 .catalog-tools-sticky{background:#fff !important;padding:10px 22px 12px !important;box-sizing:border-box;}
 .top .brand-wrap{margin-left:0 !important;}
 .top #cartBtn{margin-right:0 !important;}
 
 .top,.catalog-tools-sticky{transition:transform .22s ease;will-change:transform;}
 body.nav-hidden .top{transform:translateY(-130%);}
 body.nav-hidden .catalog-tools-sticky{transform:translateY(-220%);}
 
 .top,.catalog-tools-sticky{transition:transform .42s cubic-bezier(.22,.61,.36,1) !important;}
 .catalog-tools-sticky{padding-left:22px !important;padding-right:22px !important;width:100% !important;box-sizing:border-box !important;}
 .catalog-tools-sticky .search{width:100% !important;box-sizing:border-box !important;margin-left:0 !important;margin-right:0 !important;}
 .catalog-tools-sticky .categories{margin-left:0 !important;margin-right:0 !important;padding-left:0 !important;}
 
 html,body,main,#catalog{background:#f3f3f3 !important;}
 .top{background:#f3f3f3 !important;}
 .catalog-tools-sticky{background:#f3f3f3 !important;padding-left:0 !important;padding-right:0 !important;width:auto !important;margin-left:0 !important;margin-right:0 !important;}
 .catalog-tools-sticky .search{margin-left:0 !important;margin-right:0 !important;width:100% !important;}
 .catalog-tools-sticky .categories{margin-left:0 !important;padding-left:0 !important;}
 

/* BAD_GRINGO_MY_ORDERS_20261120 */
.bg-my-orders-btn{flex:0 0 auto;border:1px solid currentColor;border-radius:10px;background:transparent;color:inherit;padding:8px 9px;font:inherit;font-size:12px;white-space:nowrap;margin-left:auto;cursor:pointer}
.top #cartBtn{margin-left:0}
.bg-my-orders-dialog{width:min(94vw,520px);max-height:85vh;overflow:auto;border:1px solid #555;border-radius:14px;padding:18px;background:#1d1d1d;color:#fff}
.bg-my-orders-dialog::backdrop{background:rgba(0,0,0,.7)}
.bg-my-orders-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.bg-my-orders-head button{border:0;background:transparent;color:inherit;font-size:20px;cursor:pointer}
.bg-order-entry{border-top:1px solid #555;padding:12px 0}
.bg-order-title{font-weight:700;margin-bottom:4px}
.bg-order-meta{font-size:12px;opacity:.7;margin-bottom:8px}
.bg-order-line{font-size:13px;padding:4px 0}
.bg-order-total{text-align:right;font-weight:700;margin-top:8px}
@media(max-width:370px){.bg-my-orders-btn{font-size:11px;padding:6px}}
.bg-my-orders-dialog{width:calc(100% - 24px);max-width:520px;max-height:85dvh;box-sizing:border-box;padding:20px 16px;border:0;border-radius:20px;overflow-y:auto;background:#f5f5f5;color:#171717}.bg-my-orders-dialog::backdrop{background:rgba(0,0,0,.65)}.bg-my-orders-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;font-size:20px}.bg-my-orders-head button{position:static;flex-shrink:0;width:36px;height:36px;border:0;border-radius:10px;background:#222;color:white;font-size:20px}.bg-order-entry{background:white;border:1px solid #e5e5e5;border-radius:14px;padding:16px;margin-bottom:12px;overflow-wrap:anywhere}.bg-order-title{font-size:16px;font-weight:700;margin-bottom:8px}.bg-order-meta{font-size:12px;color:#777;margin-bottom:12px}.bg-order-line{font-size:14px;line-height:1.5;padding:5px 0;border-bottom:1px solid #f0f0f0}.bg-order-total{font-size:16px;font-weight:700;margin-top:12px}


/* BAD_GRINGO_MY_ORDERS_V3 */
.bg-my-orders-btn.bg-my-orders-icon{width:58px;height:58px;padding:0;display:flex;align-items:center;justify-content:center;border:1.5px solid #111;border-radius:16px;background:#fff;color:#111;flex:0 0 auto}
.bg-my-orders-icon svg{width:25px;height:25px;display:block}
.bg-my-orders-dialog{width:min(560px,calc(100% - 20px));height:min(84dvh,760px);max-height:84dvh;padding:0!important;border:0!important;border-radius:24px!important;overflow:hidden!important;background:#f5f5f5!important;color:#111!important;box-sizing:border-box}
.bg-my-orders-dialog::backdrop{background:rgba(0,0,0,.62)}
.bg-my-orders-head{position:absolute!important;z-index:20;left:0;right:0;top:0;height:76px;margin:0!important;padding:16px 18px!important;display:grid!important;grid-template-columns:42px 1fr 42px;align-items:center;gap:8px;background:rgba(245,245,245,.96);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid rgba(0,0,0,.06);box-sizing:border-box;transform:translateY(0);transition:transform .2s ease}
.bg-my-orders-head.is-hidden{transform:translateY(-100%)}
.bg-my-orders-head strong{grid-column:2;text-align:center;font-size:20px;line-height:1.1}
.bg-my-orders-close,.bg-my-orders-back{position:static!important;width:38px!important;height:38px!important;margin:0!important;padding:0!important;border:0!important;border-radius:12px!important;background:#111!important;color:#fff!important;display:flex!important;align-items:center;justify-content:center;font-size:26px!important;line-height:1!important;outline:none!important;box-shadow:none!important;-webkit-tap-highlight-color:transparent}
.bg-my-orders-back{grid-column:1;font-size:34px!important;font-weight:300!important}
.bg-my-orders-close{grid-column:3}
.bg-my-orders-back.hidden{visibility:hidden!important;display:flex!important}
.bg-my-orders-scroll{height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:92px 14px 18px;box-sizing:border-box}
.bg-orders-list{display:flex;flex-direction:column;gap:10px}
.bg-order-summary{width:100%;min-height:82px;padding:15px 16px;border:1px solid #e1e1e1;border-radius:16px;background:#fff;color:#111;display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;font:inherit;box-shadow:none;-webkit-tap-highlight-color:transparent}
.bg-order-summary-main{min-width:0}
.bg-order-summary-title{font-size:17px;font-weight:700;line-height:1.2;margin-bottom:7px}
.bg-order-summary-date{font-size:13px;color:#8d8d8d;white-space:nowrap}
.bg-order-summary-side{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.bg-order-chevron{font-size:28px;line-height:1;color:#aaa;font-weight:300}
.bg-status{display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:700;line-height:1;white-space:nowrap;background:#eee;color:#111}
.bg-status-new{background:#111;color:#fff}
.bg-status-progress{background:#e9e9e9;color:#111}
.bg-status-done{background:#dedede;color:#111}
.bg-status-cancelled{background:#f0f0f0;color:#777}
.bg-orders-empty{padding:30px 16px;text-align:center;color:#777;font-size:15px}
.bg-order-detail{padding-bottom:4px}
.bg-order-detail-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 4px 14px}
.bg-order-detail-date{font-size:13px;color:#888}
.bg-order-detail-items{display:flex;flex-direction:column;gap:10px}
.bg-order-detail-item{display:grid;grid-template-columns:92px 1fr;gap:13px;padding:11px;background:#fff;border:1px solid #e2e2e2;border-radius:16px}
.bg-order-detail-image{width:92px;height:92px;border-radius:12px;overflow:hidden;background:#eee;display:flex;align-items:center;justify-content:center}
.bg-order-detail-image img{width:100%;height:100%;object-fit:cover;display:block}
.bg-order-noimage{font-size:11px;color:#999;text-align:center}
.bg-order-detail-info{min-width:0;display:flex;flex-direction:column}
.bg-order-detail-name{font-size:15px;font-weight:700;line-height:1.25;margin:2px 0 5px}
.bg-order-detail-size{font-size:12px;color:#888;margin-bottom:8px}
.bg-order-detail-row{margin-top:auto;display:flex;align-items:flex-end;justify-content:space-between;gap:10px;font-size:12px;color:#555}
.bg-order-detail-row strong{font-size:14px;color:#111;white-space:nowrap}
.bg-order-detail-comment{margin-top:8px;padding-top:8px;border-top:1px solid #eee;font-size:12px;line-height:1.35;color:#666}
.bg-order-detail-total{display:flex;align-items:flex-end;justify-content:space-between;margin-top:12px;padding:16px 4px 4px;border-top:1px solid #ddd;font-size:16px;font-weight:700}
.bg-order-detail-total strong{font-size:22px}
@media (max-width:430px){.bg-my-orders-dialog{width:calc(100% - 16px);height:86dvh;max-height:86dvh;border-radius:22px!important}.bg-order-detail-item{grid-template-columns:84px 1fr}.bg-order-detail-image{width:84px;height:84px}}
.bg-my-orders-btn{width:64px!important;height:64px!important;min-width:64px!important;padding:0!important;border:1.5px solid #dcdcdc!important;border-radius:16px!important;background:#fff!important;color:#111!important;display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important}.bg-my-orders-btn svg{width:26px!important;height:26px!important;stroke-width:2!important}
.bg-my-orders-btn{width:50px!important;height:50px!important;min-width:50px!important;padding:0!important;border:1px solid var(--line)!important;border-radius:16px!important;background:#fff!important;color:#111!important;display:grid!important;place-items:center!important;box-sizing:border-box!important}.bg-my-orders-btn svg{width:25px!important;height:25px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.8!important;stroke-linecap:round!important;stroke-linejoin:round!important}

#productDialog .variant-group {
  min-width: 0;
  margin: 14px 0;
  padding: 0;
  border: 0;
}
#productDialog .variant-group legend {
  padding: 0;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}
#productDialog .variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#productDialog .variant-option {
  min-height: 44px;
  max-width: 100%;
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  overflow-wrap: anywhere;
}
#productDialog .variant-option[aria-pressed="true"] {
  border-color: #2b5acc;
  background: #eef3ff;
  color: #173b91;
}

/* Product forms */
#addForm, #editForm {
  display: grid;
  gap: 18px;
}
#addForm { margin-bottom: 28px; }
#editForm { margin-top: 16px; }
#addForm .row { flex-wrap: wrap; }
.product-form-section, .product-form-pair, .product-variant-fields, .variant-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.product-form-section + .product-form-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.product-form-section > h3 { margin: 0; font-size: 16px; }
.product-form-section > h3 span { color: var(--muted); font-size: 13px; font-weight: 400; }
.product-form-section label { display: block; font-size: 14px; min-width: 0; }
#addForm .product-form-section input,
.product-form-section input, .product-form-section select, .product-form-section textarea {
  margin-top: 4px;
}
.product-form-section textarea { display: block; }
.product-form-section .file { margin: 0; }
.product-variant-fields details { border: 1px solid var(--line); border-radius: 12px; }
.product-variant-fields summary {
  padding: 13px;
  cursor: pointer;
}
.variant-count { float: right; color: #575757; font-size: 14px; }
.variant-editor { padding: 0 12px 12px; }
.variant-checklist { max-height: 190px; overflow: auto; }
.product-form-section .variant-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}
#addForm .variant-check input, .variant-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
.card { cursor: pointer; }
.card:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid #2b5acc;
  outline-offset: 2px;
}
#productDialog, #cartDialog, #editDialog {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 700px) {
  main { width: min(100%, 1180px); margin-inline: auto; padding-inline: 24px; }
  .grid { gap: 16px; }
  .categories { flex-wrap: wrap; }
  #addForm { max-width: 680px; padding: 20px; }
  .product-form-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  #editDialog, #cartDialog { width: min(94vw, 680px); }
  #productDialog { width: min(94vw, 890px); }
  #productDialog .detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: start; }
  #productDialog .detail-content, #productDialog .detail-gallery { min-width: 0; }
  .tabs { justify-content: center; }
  .tabs button { flex: 0 1 240px; }
}

.category-picker { border: 1px solid var(--line); border-radius: 14px; }
.category-picker summary { padding: 13px; cursor: pointer; }
.category-picker-options { display: grid; gap: 4px; padding: 0 8px 8px; max-height: 320px; overflow-y: auto; }
.category-picker-options button { min-height: 44px; text-align: left; color: var(--text); background: var(--bg); }
.category-picker-options button[aria-pressed="true"] { background: #eef3ff; color: #173b91; }
.category-picker-options button[data-custom] { border: 1px dashed var(--line); background: var(--card); }
.product-form-section .file span { color: var(--muted); }

.grid-density { display: none; }
@media (min-width: 760px) {
  body { padding-bottom: 20px; }
  .top {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px max(20px, calc((100% - 1132px) / 2)) !important;
  }
  body.nav-hidden .top { transform: none; }
  .top .brand-wrap { min-height: 42px; }
  .top .brand-subtitle { display: none; }
  .top .brand-title { font-size: 21px; }
  .top .tabs {
    position: static;
    justify-content: flex-start;
    margin-inline: auto;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }
  .top .tabs button { flex: 0 0 auto; padding: 9px 16px; }
  #catalog {
    display: grid;
    grid-template-columns: minmax(150px, 185px) minmax(0, 1fr);
    gap: 12px 18px;
    align-items: start;
  }
  #catalog .catalog-tools-sticky { display: contents; }
  #catalog .catalog-search-row { grid-column: 2; display: flex; align-items: center; gap: 10px; min-width: 0; }
  #catalog #search { min-width: 0; flex: 1 1 auto; padding: 10px 12px; }
  .grid-density { display: flex; align-items: center; gap: 4px; white-space: nowrap; flex: 0 0 auto; }
  .grid-density span { margin-right: 4px; font-size: 13px; }
  .grid-density button { min-width: 32px; min-height: 36px; padding: 6px; background: #fff; color: #111; border: 1px solid var(--line); }
  .grid-density button[aria-pressed="true"] { background: #111; color: #fff; border-color: #111; }
  #catalog #categories {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: grid;
    padding: 0;
    gap: 4px;
    overflow: visible;
  }
  #catalog .category-btn { text-align: left; white-space: normal; border-radius: 9px; padding: 8px 10px; }
  #grid, #empty { grid-column: 2; }
  #grid { grid-template-columns: repeat(var(--desktop-columns, 4), minmax(0, 1fr)); gap: 10px; }
  #grid .card { min-width: 0; }
  #grid .card img {
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--card);
  }
  #grid .card { display: flex; flex-direction: column; }
  #grid .card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 6px 9px 8px;
  }
  #grid .article:empty { display: none; }
  #grid .name { margin: 0; min-height: 0; overflow-wrap: anywhere; }
  #grid .product-size { margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
  #grid .price { margin: auto 0 0; padding-top: 2px; }
  #addForm, #editForm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 12px 22px;
  }
  #addForm { max-width: none; margin-bottom: 20px; }
  #editDialog { width: min(94vw, 1000px); }
  #addForm > .product-form-section:nth-child(2),
  #editForm > .product-form-section:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
    border: 0;
    padding-top: 0;
  }
  #addForm > .product-form-section:nth-child(3),
  #editForm > .product-form-section:nth-child(3) { grid-column: 1; }
  #addForm > .row, #editForm > #v7GalleryAdmin, #editForm > button[type="submit"] { grid-column: 1 / -1; }
  #addForm > .row { justify-content: flex-start; }
  #addForm > .row > * { flex: 0 1 190px; }
  #editForm > button[type="submit"] {
    position: sticky;
    bottom: 0;
    width: auto;
    min-width: 205px;
    justify-self: start;
    z-index: 1;
  }
  #addForm input, #editForm input, #addForm textarea, #editForm textarea { padding: 9px 11px; }
  #addForm .variant-check input, #editForm .variant-check input { padding: 0; }
}

#grid .product-size:empty { display: none; }

/* GRINGO EDC */
:root {
  color-scheme: dark;
  --bg: #14120e;
  --card: #201c15;
  --text: #ebdfc4;
  --muted: #bcad8e;
  --line: #51432d;
  --accent: #caa55e;
}
html, body, main, #catalog { background: var(--bg) !important; color: var(--text); }
.top, .catalog-tools-sticky { background: var(--bg) !important; }
.top { border-bottom: 1px solid var(--line); }
.brand-title { color: #d3b16d; font-family: Georgia, serif; }
.brand-subtitle { color: var(--muted); }
.card, .panel, dialog, .admin-item, .admin-menu button, .order-card, .tabs {
  background: var(--card); color: var(--text); border-color: var(--line);
}
.bg-my-orders-dialog { background: var(--card) !important; color: var(--text) !important; }
.bg-my-orders-dialog .bg-my-orders-head, .bg-my-orders-dialog .bg-order-card {
  background: var(--card); color: var(--text); border-color: var(--line);
}
.search, input, select, textarea, .cart-button, .top .bg-my-orders-icon {
  background: #19160f; color: var(--text); border-color: var(--line);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
button, .cart-count { background: var(--accent); color: #18130a; }
.tabs button, .category-btn, .grid-density button {
  background: var(--card); color: var(--text); border-color: var(--line);
}
.tabs .active, .category-btn.active, .grid-density button[aria-pressed="true"] {
  background: var(--accent); color: #18130a; border-color: var(--accent);
}
#productDialog .variant-option[aria-pressed="true"], .category-picker-options button[aria-pressed="true"] {
  background: #3a2d17; border-color: var(--accent); color: #f0d291;
}
.desc, .variant-count { color: var(--muted); }
#grid .price, #productDialog .price { color: #e0be7a; }
