.tnl-b2b-portal,
.tnl-b2b-portal * { box-sizing: border-box; }
.tnl-b2b-portal { color: var(--tnl-text, #111); font-family: Arial, Helvetica, sans-serif; line-height: 1.45; background: var(--tnl-bg, #f1fbef); padding: clamp(16px, 3vw, 42px); border-radius: 24px; max-width: 1500px; margin: 24px auto; }
.tnl-b2b-portal h1,.tnl-b2b-portal h2,.tnl-b2b-portal h3 { color: var(--tnl-text, #111); line-height: 1.15; }
.tnl-b2b-portal h1 { font-size: clamp(30px, 5vw, 58px); margin: 5px 0 12px; }
.tnl-b2b-portal h2 { font-size: 24px; margin: 0 0 18px; }
.tnl-b2b-portal h3 { font-size: 20px; margin: 0 0 8px; }
.tnl-b2b-portal a { color: var(--tnl-accent-dark, #087a28); }
.tnl-eyebrow { font-weight: 800; letter-spacing: .13em; color: var(--tnl-accent-dark, #087a28); font-size: 12px; }
.tnl-hero,.tnl-dashboard-header { border: 3px solid var(--tnl-accent, #16a83e); background: linear-gradient(135deg, #fff 0%, var(--tnl-bg, #f1fbef) 100%); border-radius: 24px; padding: clamp(24px, 5vw, 52px); position: relative; overflow: hidden; margin-bottom: 24px; }
.tnl-hero::after,.tnl-dashboard-header::after { content:""; position:absolute; width:220px; height:220px; right:-80px; top:-90px; border:28px solid var(--tnl-accent, #16a83e); border-radius:50%; opacity:.16; }
.tnl-dashboard-header { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:28px 34px; }
.tnl-dashboard-header h1 { font-size: clamp(28px, 4vw, 44px); }
.tnl-panel,.tnl-order-summary,.tnl-empty-state { background:#fff; border:1px solid rgba(8,122,40,.22); border-radius:18px; padding:clamp(18px,3vw,28px); box-shadow:0 12px 34px rgba(7,65,23,.07); }
.tnl-auth-grid,.tnl-agent-layout,.tnl-checkout-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin-bottom:24px; }
.tnl-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.tnl-span-2 { grid-column:1/-1; }
.tnl-form label,.tnl-personalization-fields label,.tnl-reservation-fields label,.tnl-riba-fields label,.tnl-admin-card label { display:flex; flex-direction:column; gap:6px; font-weight:700; margin-bottom:12px; }
.tnl-form input,.tnl-form textarea,.tnl-form select,.tnl-product-search,.tnl-category-filter,.tnl-inline-form select,.tnl-personalization-fields input,.tnl-personalization-fields textarea,.tnl-reservation-fields input,.tnl-riba-fields input { width:100%; border:2px solid #c9e8cf; background:#fff; color:#111; border-radius:10px; padding:12px 13px; font:inherit; }
.tnl-form input:focus,.tnl-form textarea:focus,.tnl-form select:focus,.tnl-product-search:focus,.tnl-category-filter:focus,.tnl-riba-fields input:focus { outline:none; border-color:var(--tnl-accent,#16a83e); box-shadow:0 0 0 3px rgba(22,168,62,.14); }
.tnl-check { display:flex!important; flex-direction:row!important; align-items:flex-start; gap:10px!important; font-weight:400!important; margin:14px 0!important; }
.tnl-check input { width:auto!important; margin-top:4px; accent-color:var(--tnl-accent,#16a83e); }
.tnl-consents { padding:14px 16px; background:var(--tnl-bg,#f1fbef); border-radius:12px; margin:16px 0; }
.tnl-button { appearance:none; border:2px solid var(--tnl-accent,#16a83e); border-radius:10px; background:var(--tnl-accent,#16a83e); color:#fff!important; padding:11px 18px; font-weight:800; text-decoration:none!important; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:.18s ease; }
.tnl-button:hover { background:var(--tnl-accent-dark,#087a28); border-color:var(--tnl-accent-dark,#087a28); transform:translateY(-1px); }
.tnl-button:disabled { opacity:.55; cursor:wait; transform:none; }
.tnl-button-secondary { background:#fff; color:var(--tnl-accent-dark,#087a28)!important; }
.tnl-button-large { width:100%; font-size:17px; padding:15px 22px; }
.tnl-notice { border-radius:12px; padding:16px 18px; margin-bottom:20px; border-left:6px solid; background:#fff; }
.tnl-success { border-color:var(--tnl-accent,#16a83e); }
.tnl-error { border-color:#b42318; background:#fff4f2; }
.tnl-inline-form { display:flex; gap:10px; }
.tnl-inline-form select { flex:1; }
.tnl-catalog-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) minmax(210px,.35fr) auto; gap:12px; margin:24px 0; position:sticky; top:10px; z-index:20; background:rgba(241,251,239,.96); backdrop-filter:blur(8px); padding:12px; border-radius:14px; border:1px solid #c9e8cf; }
.tnl-products-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin-bottom:26px; align-items:start; }
.tnl-product-card { background:#fff; border:1px solid #c9e8cf; border-radius:17px; overflow:hidden; display:flex; flex-direction:column; min-width:0; height:auto; align-self:start; box-shadow:0 7px 24px rgba(7,65,23,.06); }
.tnl-product-card[hidden] { display:none; }
.tnl-product-image { aspect-ratio:4/3; background:var(--tnl-bg,#f1fbef); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.tnl-product-image img { width:100%; height:100%; object-fit:contain; padding:14px; }
.tnl-product-content { padding:18px; display:flex; flex-direction:column; flex:1; }
.tnl-sku { color:#516358; font-size:13px; margin-bottom:8px; }
.tnl-short-description { font-size:14px; color:#34483a; margin-bottom:12px; }
.tnl-variations { display:flex; flex-direction:column; gap:10px; margin-top:14px; }
.tnl-variations-title { color:var(--tnl-accent-dark,#087a28); font-weight:900; font-size:14px; letter-spacing:.02em; }
.tnl-order-row { margin-top:auto; border-top:1px solid #dfeee1; padding-top:14px; min-width:0; }
.tnl-variations .tnl-order-row { margin-top:0; padding:14px; border:1px solid #cfe7d3; border-radius:12px; background:#fbfefb; overflow:hidden; }
.tnl-variation-row { display:grid; grid-template-columns:minmax(0,1fr); align-items:stretch; gap:10px; }
.tnl-variation-info { min-width:0; padding-bottom:9px; border-bottom:1px solid #e2eee4; }
.tnl-variation-label { font-weight:900; font-size:15px; line-height:1.3; margin-bottom:4px; overflow-wrap:anywhere; }
.tnl-variation-sku { color:#516358; font-size:12px; overflow-wrap:anywhere; }
.tnl-price-block { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px 12px; min-width:0; margin-bottom:12px; }
.tnl-variation-row .tnl-price-block { margin-bottom:0; }
.tnl-price-promotion { grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:7px 10px; min-width:0; }
.tnl-discount-badge { flex:0 0 auto; background:var(--tnl-accent,#16a83e); color:#fff; border-radius:999px; padding:3px 8px; font-weight:900; font-size:12px; }
.tnl-old-price { min-width:0; color:#68796d; font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.tnl-old-price>span { margin-right:4px; }
.tnl-old-price .woocommerce-Price-amount { text-decoration:line-through; }
.tnl-current-price,.tnl-gross-price { min-width:0; display:flex; flex-direction:column; gap:1px; }
.tnl-current-price strong,.tnl-gross-price strong { display:block; min-width:0; color:var(--tnl-accent-dark,#087a28); font-size:19px; line-height:1.15; overflow-wrap:anywhere; }
.tnl-current-price>span,.tnl-gross-price>span { color:#4c6252; font-size:11px; font-weight:700; }
.tnl-gross-price { padding-left:12px; border-left:1px solid #dfeee1; }
.tnl-quantity { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; font-weight:800; }
.tnl-quantity>span { flex:0 0 auto; }
.tnl-quantity-control { flex:0 1 210px; width:100%; min-width:132px; display:grid; grid-template-columns:40px minmax(52px,1fr) 40px; border:2px solid var(--tnl-accent,#16a83e); border-radius:9px; overflow:hidden; }
.tnl-quantity button { min-width:0; min-height:40px; border:0; padding:0; background:var(--tnl-accent,#16a83e); color:#fff; font-size:21px; line-height:1; cursor:pointer; }
.tnl-quantity button:hover { background:var(--tnl-accent-dark,#087a28); }
.tnl-quantity input { width:100%; min-width:0; height:40px; text-align:center; border:0; border-radius:0; padding:6px 2px; color:#111; background:#fff; font:inherit; appearance:textfield; }
.tnl-quantity input::-webkit-inner-spin-button { appearance:none; }
.tnl-gift-quantity { margin-top:9px; padding-top:9px; border-top:1px dashed #b7d9bd; }
.tnl-gift-quantity>span { color:var(--tnl-accent-dark,#087a28); }
.tnl-gift-control { border-style:dashed; background:#f7fcf6; }
.tnl-gift-control button { background:var(--tnl-accent-dark,#087a28); }
.tnl-gift-control button:hover { background:var(--tnl-accent,#16a83e); }
.tnl-summary-gifts { background:var(--tnl-bg,#f1fbef); margin:0 -6px; padding-left:6px!important; padding-right:6px!important; border-radius:7px; }
.tnl-personalization { margin-bottom:20px; border-left:8px solid var(--tnl-accent,#16a83e); }
.tnl-switch-row { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.tnl-switch-row span { display:flex; flex-direction:column; }
.tnl-switch-row small { font-weight:400; color:#4f6154; }
.tnl-switch-row input { width:54px; height:28px; accent-color:var(--tnl-accent,#16a83e); }
.tnl-personalization-fields { display:grid; grid-template-columns:1fr 1fr; gap:14px; padding-top:18px; }
.tnl-reservation { margin-bottom:20px; border-left:8px solid #d38b16; }
.tnl-field-intro { margin:-5px 0 16px; color:#4f6154; }
.tnl-reservation-fields { display:grid; grid-template-columns:minmax(0,420px); gap:14px; padding:4px 14px 0 38px; }
.tnl-reservation-fields[hidden] { display:none; }
.tnl-reservation-fields small { font-weight:400; color:#536358; }
.tnl-checkout-layout { grid-template-columns:minmax(0,1fr) minmax(310px,.48fr); align-items:start; }
.tnl-payment-option { display:flex; flex-direction:row; align-items:flex-start; gap:12px; border:2px solid #d5ead8; padding:14px; border-radius:12px; margin-bottom:12px; cursor:pointer; }
.tnl-payment-option:has(input:checked) { border-color:var(--tnl-accent,#16a83e); background:var(--tnl-bg,#f1fbef); }
.tnl-payment-option input { width:auto; margin-top:4px; accent-color:var(--tnl-accent,#16a83e); }
.tnl-payment-option span { display:flex; flex-direction:column; }
.tnl-payment-option small { font-weight:400; color:#536358; }
.tnl-commercial-note { background:var(--tnl-bg,#f1fbef); border-radius:10px; padding:13px; margin-top:15px; }
.tnl-order-summary { position:sticky; top:96px; border:3px solid var(--tnl-accent,#16a83e); }
.tnl-summary-items { max-height:220px; overflow:auto; border-bottom:1px solid #dfeee1; padding-bottom:10px; margin-bottom:10px; }
.tnl-summary-items>div { display:flex; justify-content:space-between; gap:10px; padding:5px 0; font-size:13px; }
.tnl-order-summary dl { margin:0 0 15px; }
.tnl-order-summary dl>div { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px dotted #bad6bf; }
.tnl-order-summary dt { font-weight:700; }
.tnl-order-summary dd { margin:0; text-align:right; }
.tnl-summary-note { font-size:12px; color:#56685b; }
.tnl-orders-history { margin-top:26px; }
.tnl-table-wrap { overflow:auto; }
.tnl-table-wrap table { width:100%; border-collapse:collapse; min-width:650px; }
.tnl-table-wrap th,.tnl-table-wrap td { padding:12px; border-bottom:1px solid #dbeadc; text-align:left; }
.tnl-table-wrap th { color:var(--tnl-accent-dark,#087a28); }
.tnl-empty-state { text-align:center; margin:24px 0; border:2px dashed var(--tnl-accent,#16a83e); }
.tnl-unavailable { color:#7d2b22; font-weight:700; }
.tnl-b2b-portal details summary { cursor:pointer; color:var(--tnl-accent-dark,#087a28); margin-bottom:16px; }
@media (max-width:1100px){.tnl-products-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tnl-checkout-layout{grid-template-columns:1fr}.tnl-order-summary{position:static}}
@media (max-width:760px){.tnl-b2b-portal{padding:12px;border-radius:0;margin:0}.tnl-auth-grid,.tnl-agent-layout,.tnl-form-grid,.tnl-personalization-fields,.tnl-reservation-fields{grid-template-columns:1fr}.tnl-span-2{grid-column:auto}.tnl-dashboard-header{align-items:flex-start;flex-direction:column}.tnl-catalog-toolbar{grid-template-columns:1fr;position:static}.tnl-products-grid{grid-template-columns:1fr}.tnl-inline-form{flex-direction:column}.tnl-product-card{flex-direction:row}.tnl-product-image{width:34%;min-width:110px;aspect-ratio:auto}.tnl-product-content{width:66%;padding:14px}.tnl-current-price strong,.tnl-gross-price strong{font-size:17px}}
@media (max-width:480px){.tnl-product-card{flex-direction:column}.tnl-product-image,.tnl-product-content{width:100%}.tnl-product-image{aspect-ratio:16/9}.tnl-price-block{grid-template-columns:1fr}.tnl-price-promotion{grid-column:auto}.tnl-gross-price{padding-left:0;padding-top:7px;border-left:0;border-top:1px solid #dfeee1}.tnl-quantity{align-items:flex-start;flex-direction:column}.tnl-quantity-control{flex-basis:auto;width:100%;max-width:none;grid-template-columns:44px minmax(0,1fr) 44px}}

/* Accesso e caricamento progressivo del catalogo. */
.tnl-b2b-portal #loginform input[type="submit"] { appearance:none; border:2px solid var(--tnl-accent,#16a83e); border-radius:10px; background:var(--tnl-accent,#16a83e); color:#fff; padding:12px 18px; font-weight:800; cursor:pointer; transition:.18s ease; }
.tnl-b2b-portal #loginform input[type="submit"]:hover { background:var(--tnl-accent-dark,#087a28); border-color:var(--tnl-accent-dark,#087a28); }
.tnl-b2b-portal #loginform input[type="submit"]:disabled { opacity:.62; cursor:wait; }
.tnl-login-progress { display:flex; align-items:center; gap:12px; margin:16px 0; padding:14px 16px; border:1px solid #c9e8cf; border-radius:12px; background:var(--tnl-bg,#f1fbef); }
.tnl-login-progress[hidden] { display:none; }
.tnl-login-progress span:last-child { display:flex; flex-direction:column; gap:2px; }
.tnl-login-progress small { color:#506258; }
.tnl-is-authenticating #loginform { opacity:.78; }
.tnl-spinner { display:inline-block; flex:0 0 auto; width:24px; height:24px; border:3px solid rgba(22,168,62,.22); border-top-color:var(--tnl-accent,#16a83e); border-radius:50%; animation:tnl-spin .75s linear infinite; }
.tnl-spinner-large { width:42px; height:42px; border-width:5px; }
@keyframes tnl-spin { to { transform:rotate(360deg); } }
.tnl-catalog-loader { min-height:150px; margin:24px 0; border:2px dashed #b9debf; border-radius:18px; background:rgba(255,255,255,.72); }
.tnl-catalog-loader-inner { min-height:150px; display:flex; align-items:center; justify-content:center; gap:18px; padding:28px; text-align:left; }
.tnl-catalog-loader-inner h2 { margin:0 0 6px; }
.tnl-catalog-loader-inner p { margin:0; color:#4f6254; }
.tnl-catalog-loader.tnl-catalog-loaded { min-height:0; margin:0; border:0; border-radius:0; background:transparent; }
.tnl-catalog-loader.tnl-catalog-load-error { min-height:0; border:0; background:transparent; }
.tnl-catalog-retry { margin-top:14px; }
@media (prefers-reduced-motion:reduce){.tnl-spinner{animation-duration:1.5s}.tnl-button,.tnl-b2b-portal #loginform input[type="submit"]{transition:none}}

/* Navigazione gerarchica del catalogo: categorie > sottocategorie > articoli. */
.tnl-category-browser { margin:22px 0 30px; }
.tnl-category-browser[hidden],.tnl-products-section[hidden],.tnl-category-level[hidden] { display:none!important; }
.tnl-category-intro { background:#fff; border:1px solid #c9e8cf; border-left:7px solid var(--tnl-accent,#16a83e); border-radius:16px; padding:20px 22px; margin-bottom:14px; }
.tnl-category-intro h2 { margin:4px 0 7px; }
.tnl-category-intro p { margin:0; color:#435648; }
.tnl-category-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:10px 2px 14px; }
.tnl-category-breadcrumb button { appearance:none; border:0; background:transparent; color:var(--tnl-accent-dark,#087a28); padding:5px 4px; font:inherit; font-weight:800; cursor:pointer; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }
.tnl-category-breadcrumb button:last-child { color:#111; text-decoration:none; }
.tnl-breadcrumb-separator { color:#6e7f72; font-weight:900; }
.tnl-category-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; align-items:start; }
.tnl-category-card { appearance:none; width:100%; display:flex; flex-direction:column; align-items:stretch; gap:0; overflow:hidden; text-align:left; border:2px solid #bfe3c6; border-radius:16px; background:#fff; color:#111; padding:0; cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease; box-shadow:0 7px 22px rgba(7,65,23,.05); }
.tnl-category-card:hover,.tnl-category-card:focus-visible { border-color:var(--tnl-accent,#16a83e); background:#f8fff7; transform:translateY(-1px); outline:none; }
.tnl-category-media { width:100%; aspect-ratio:16/9; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#edf8ed; border-bottom:1px solid #d5ead9; }
.tnl-category-media img { width:100%; height:100%; display:block; object-fit:cover; }
.tnl-category-media-fallback { background:linear-gradient(135deg,#effbee,#dff4df); }
.tnl-category-mark { width:54px; height:54px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--tnl-accent,#16a83e); color:#fff; font-size:27px; font-weight:900; line-height:1; }
.tnl-category-card-products .tnl-category-mark { background:var(--tnl-accent-dark,#087a28); }
.tnl-category-card-bottom { width:100%; min-width:0; display:grid; grid-template-columns:minmax(0,1fr) 28px; align-items:center; gap:14px; padding:16px 18px 18px; }
.tnl-category-card-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }
.tnl-category-card-copy strong { font-size:18px; line-height:1.2; overflow-wrap:anywhere; }
.tnl-category-card-copy small { color:#536458; font-size:13px; }
.tnl-category-arrow { color:var(--tnl-accent,#16a83e); font-size:25px; font-weight:900; text-align:right; }
.tnl-products-section { margin:22px 0 30px; }
.tnl-products-heading { display:flex; align-items:center; gap:18px; background:#fff; border:1px solid #c9e8cf; border-left:7px solid var(--tnl-accent,#16a83e); border-radius:16px; padding:16px 20px; margin-bottom:18px; }
.tnl-products-heading h2 { margin:3px 0 2px; }
.tnl-products-heading p { margin:0; color:#536458; }
.tnl-category-back { appearance:none; flex:0 0 auto; border:2px solid var(--tnl-accent,#16a83e); border-radius:10px; background:#fff; color:var(--tnl-accent-dark,#087a28); padding:10px 13px; font:inherit; font-weight:800; cursor:pointer; }
.tnl-category-back:hover,.tnl-category-back:focus-visible { background:var(--tnl-bg,#f1fbef); outline:none; }
@media (max-width:1100px){.tnl-category-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){.tnl-category-grid{grid-template-columns:1fr}.tnl-products-heading{align-items:flex-start;flex-direction:column}.tnl-category-media{aspect-ratio:2/1}}


.tnl-carton-info { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:-2px 0 12px; padding:9px 11px; border:1px solid #cfe7d3; border-radius:10px; background:#f7fcf8; font-size:12px; color:#294a32; }
.tnl-carton-info span { white-space:nowrap; font-weight:600; }

.tnl-catalog-validity { margin:8px 0 12px; padding:9px 11px; border:1px solid #e7c66a; border-radius:10px; background:#fff8e8; color:#7a4313; font-size:12px; line-height:1.35; }
.tnl-catalog-validity strong, .tnl-catalog-validity span { display:block; }
.tnl-catalog-validity span { margin-top:2px; }

/* 0.2.16 - caricamento prodotti per categoria */
.tnl-products-loading{display:flex;align-items:center;gap:10px;padding:18px 4px;font-weight:600}.tnl-products-loading[hidden]{display:none}.tnl-products-grid[aria-busy="true"]{min-height:80px}
