:root{
  --coffee:#2b160d;
  --coffee-2:#4b2a18;
  --gold:#c99746;
  --cream:#fff8ed;
  --soft:#f5ead9;
  --white:#ffffff;
  --danger:#b3261e;
  --ok:#2f7d32;
  --shadow:0 14px 35px rgba(43,22,13,.14);
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--cream);
  color:var(--coffee);
}
a{text-decoration:none;color:inherit}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  background:linear-gradient(90deg,var(--coffee),var(--coffee-2));
  color:white;
  box-shadow:0 3px 14px rgba(0,0,0,.15);
}
.nav{
  max-width:1200px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  gap:16px;
}
.brand{
  font-weight:800;
  font-size:21px;
  letter-spacing:.3px;
}
.menu{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.menu a{
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  color:white;
  font-size:14px;
}
.menu a:hover,.menu a.active{
  background:var(--gold);
  color:var(--coffee);
}
.hero{
  min-height:calc(100vh - 64px);
  background:
    linear-gradient(90deg,rgba(43,22,13,.72),rgba(43,22,13,.2)),
    url('home.jpg') center/contain no-repeat,
    #201008;
  display:flex;
  align-items:center;
}
.hero-inner{
  max-width:1200px;
  margin:auto;
  width:100%;
  padding:60px 22px;
}
.hero-card{
  width:min(520px,100%);
  background:rgba(255,248,237,.9);
  border:1px solid rgba(201,151,70,.35);
  border-radius:28px;
  padding:34px;
  box-shadow:var(--shadow);
}
.hero h1{font-size:44px;margin:0 0 10px}
.hero p{font-size:18px;line-height:1.45}
.btn{
  border:0;
  border-radius:999px;
  padding:12px 18px;
  background:var(--gold);
  color:var(--coffee);
  font-weight:800;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn.secondary{background:var(--coffee);color:white}
.btn.ghost{background:white;border:1px solid #eadcc8}
.btn.danger{background:var(--danger);color:white}
.btn.small{padding:8px 12px;font-size:13px}
.container{
  max-width:1200px;
  margin:auto;
  padding:24px 18px 60px;
}
.page-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin:10px 0 22px;
  flex-wrap:wrap;
}
.page-head h1{margin:0;font-size:32px}
.page-head p{margin:6px 0 0;color:#6b5544}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
}
.card{
  background:white;
  border:1px solid #eadcc8;
  border-radius:22px;
  padding:20px;
  box-shadow:var(--shadow);
}
.card h2,.card h3{margin-top:0}
.admin-card{
  min-height:190px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.admin-card p{color:#6b5544;line-height:1.4}
.form-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:12px;
  margin:12px 0;
}
label{font-weight:700;font-size:13px;display:block;margin-bottom:6px}
input,select,textarea{
  width:100%;
  border:1px solid #e2d1bd;
  border-radius:14px;
  padding:11px 12px;
  background:white;
  color:var(--coffee);
}
textarea{min-height:90px}
.table-wrap{overflow:auto;border-radius:18px;border:1px solid #eadcc8}
table{width:100%;border-collapse:collapse;background:white}
th,td{padding:12px;border-bottom:1px solid #eadcc8;text-align:left;font-size:14px;vertical-align:middle}
th{background:#f6ead9;color:var(--coffee)}
tr:last-child td{border-bottom:0}
.notice{
  padding:14px 16px;
  border-radius:16px;
  background:#fff2d8;
  border:1px solid #efd29a;
  margin:14px 0;
}
.ok{color:var(--ok);font-weight:800}
.danger-text{color:var(--danger);font-weight:800}
.catalog-section{margin-bottom:26px}
.category-title{
  display:flex;
  align-items:center;
  gap:14px;
  background:var(--coffee);
  color:white;
  border-radius:20px;
  padding:12px 14px;
}
.category-title img,.brand-title img{
  width:56px;height:56px;object-fit:cover;border-radius:14px;background:white;
}
.brand-title{
  display:flex;
  align-items:center;
  gap:12px;
  margin:18px 0 10px;
  color:var(--coffee);
}
.product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
}
.product{
  background:white;
  border:1px solid #eadcc8;
  border-radius:22px;
  padding:14px;
  box-shadow:var(--shadow);
}
.product img{
  width:100%;
  height:160px;
  object-fit:contain;
  border-radius:16px;
  background:#fffaf1;
}
.product h3{font-size:16px;margin:10px 0 8px}
.price{font-size:20px;font-weight:900;color:var(--coffee)}
.badge{
  display:inline-block;
  padding:5px 9px;
  border-radius:999px;
  background:#f0dfc5;
  font-size:12px;
  margin-top:6px;
}
.hidden{display:none!important}
@media(max-width:720px){
  .nav{align-items:flex-start;flex-direction:column}
  .menu{justify-content:flex-start}
  .hero h1{font-size:34px}
}

.hero-inner{
  position:relative;
}
.hero-actions{
  position:absolute;
  top:26%;
  left:50%;
  transform:translateX(-50%);
  width:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  z-index:5;
}
.store-btn{
  font-size:18px;
  letter-spacing:1.5px;
  padding:15px 34px;
  box-shadow:0 12px 28px rgba(0,0,0,.22);
}

@media(max-width:768px){
  .hero-actions{
    top:22%;
  }
}


.breadcrumb{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:-8px 0 20px;
  color:#6b5544;
  font-size:14px;
}
.breadcrumb a{
  color:var(--coffee);
  font-weight:800;
}
.store-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:18px;
}
.store-card{
  background:white;
  border:1px solid #eadcc8;
  border-radius:24px;
  overflow:hidden;
  cursor:pointer;
  box-shadow:var(--shadow);
  transition:.18s ease;
}
.store-card:hover{
  transform:translateY(-3px);
  box-shadow:0 18px 38px rgba(43,22,13,.18);
}
.store-card img{
  width:100%;
  height:190px;
  object-fit:contain;
  background:#fffaf1;
  padding:14px;
}
.store-card-body{
  padding:16px;
  border-top:1px solid #f0dfc5;
}
.store-card-body h2{
  margin:0 0 6px;
  font-size:20px;
}
.store-card-body p{
  margin:0;
  color:#6b5544;
}
.product{
  transition:.18s ease;
}
.product:hover{
  transform:translateY(-2px);
}

.cart-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:var(--gold);
  color:var(--coffee);
  font-size:12px;
  font-weight:900;
  margin-left:4px;
}
.cart-total{
  margin-top:18px;
  padding:18px;
  background:#fff8ed;
  border:1px solid #eadcc8;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.cart-total strong{
  font-size:26px;
}
.pay-option{
  display:block;
  padding:12px 14px;
  margin:8px 0;
  border:1px solid #eadcc8;
  border-radius:14px;
  background:#fffaf1;
  font-weight:700;
}
.pay-option input{
  width:auto;
  margin-right:8px;
}
.order-card{
  margin-bottom:18px;
}


.add-cart-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
}
.qty-input{
  width:76px;
  text-align:center;
  font-weight:800;
  padding:8px 10px;
  border-radius:999px;
}
.add-cart-row .btn{
  flex:1;
}


.guest-box{
  background:#fff8ed;
  border:1px solid #eadcc8;
  border-radius:18px;
  padding:16px;
  margin-bottom:18px;
}
.guest-box h2{
  margin:0 0 6px;
}
.guest-box p{
  margin:0;
  color:#6b5544;
}

.auth-card{
  max-width:760px;
}
.auth-card a{
  color:var(--coffee);
  text-decoration:underline;
}

.customer-type-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
  margin:8px 0 18px;
}


.search-box{
  background:white;
  border:1px solid #eadcc8;
  border-radius:22px;
  padding:16px;
  box-shadow:var(--shadow);
  margin:0 0 22px;
}
.search-box label{
  font-size:15px;
  margin-bottom:8px;
}
.search-row{
  display:flex;
  gap:10px;
  align-items:center;
}
.search-row input{
  font-size:16px;
  padding:13px 14px;
}
.search-row .btn{
  white-space:nowrap;
}
.search-hint{
  margin:8px 0 0;
  color:#6b5544;
  font-size:13px;
}
@media(max-width:720px){
  .search-row{flex-direction:column;align-items:stretch}
}


/* Tasto Backoffice visibile solo al proprietario/admin */
.owner-backoffice-btn{
  background:#2f160b !important;
  color:#fff !important;
  border-radius:999px;
  padding:9px 14px !important;
  font-weight:900;
  box-shadow:0 8px 18px rgba(47,22,11,.22);
}
.owner-backoffice-btn:hover{
  transform:translateY(-1px);
}

.owner-tools{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}


.cart-product-cell{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:240px;
}
.cart-qty-control{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:150px;
}
.cart-qty-control input{
  width:64px;
  text-align:center;
  font-weight:900;
  padding:8px 6px;
  border-radius:999px;
}
.btn.small{
  padding:8px 10px;
  font-size:12px;
}
@media(max-width:720px){
  .cart-product-cell{min-width:180px;align-items:flex-start}
  .cart-qty-control{min-width:130px}
}

/* === HOME PC DINAMICA 5.5.3 === */
body.cp-home-page .cp-desktop-home-hero{
  width:100vw!important;
  max-width:100vw!important;
  margin:0!important;
  padding:0!important;
  min-height:calc(100vh - 64px);
  background-size:cover!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
  background-color:#fff7ec!important;
}
body.cp-home-page .cp-desktop-home-hero .hero-inner{position:relative;min-height:calc(100vh - 64px);padding:0!important;max-width:none!important;}
body.cp-home-page .cp-desktop-home-hero .hero-actions{position:absolute;left:50%;top:58%;transform:translate(-50%,-50%);}
body.cp-home-page .cp-desktop-home-hero .store-btn{font-size:28px;padding:18px 58px;border-radius:999px;box-shadow:0 8px 20px rgba(0,0,0,.25);}


/* === FIX 5.5.4 BORDO BIANCO HOME DESKTOP === */
body.cp-home-page,
body.cp-home-page #page,
body.cp-home-page .site,
body.cp-home-page .site-content,
body.cp-home-page .ast-container,
body.cp-home-page .content-area,
body.cp-home-page .entry-content{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden!important;
}
body.cp-home-page .cp-desktop-home-hero{
  width:100vw!important;
  max-width:100vw!important;
  margin-left:calc(50% - 50vw)!important;
  margin-right:calc(50% - 50vw)!important;
  padding:0!important;
  border:0!important;
  min-height:calc(100vh - 64px)!important;
  background-size:cover!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
}
body.cp-home-page .cp-desktop-home-hero .hero-inner{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
}
@media (min-width:431px){
  body.cp-home-page .cp-mobile-home-stage{display:none!important;}
}


/* === FIX 5.5.7 HOME PC: foto intera, senza taglio e senza bordi === */
@media (min-width:431px){
  html, body{margin:0!important;padding:0!important;overflow-x:hidden!important;}
  body.cp-home-page,
  body.cp-home-page #page,
  body.cp-home-page .site,
  body.cp-home-page .site-content,
  body.cp-home-page .ast-container,
  body.cp-home-page .content-area,
  body.cp-home-page .entry-content{
    width:100vw!important;
    max-width:100vw!important;
    margin:0!important;
    padding:0!important;
    overflow-x:hidden!important;
  }
  body.cp-home-page .cp-desktop-home-hero{
    display:block!important;
    width:100vw!important;
    max-width:100vw!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    min-height:0!important;
    height:auto!important;
    aspect-ratio:2048 / 853!important;
    background-size:100% 100%!important;
    background-position:center center!important;
    background-repeat:no-repeat!important;
    overflow:hidden!important;
  }
  body.cp-home-page .cp-desktop-home-hero .hero-inner{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    aspect-ratio:2048 / 853!important;
    margin:0!important;
    padding:0!important;
    position:relative!important;
  }
}


/* 5.6.3 - Store: scelta percorso Categorie/Marchi o Marchi/Categorie */
.store-path-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  max-width:900px;
  margin:0 auto;
}
.store-path-card{
  min-height:250px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
}
.store-path-icon{
  height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:72px;
  background:#fffaf1;
  border-bottom:1px solid #f0dfc5;
}
@media (max-width:430px){
  body.cp-store-page .store-path-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body.cp-store-page .store-path-card{
    min-height:160px!important;
    border-radius:18px!important;
  }
  body.cp-store-page .store-path-icon{
    height:88px!important;
    font-size:42px!important;
  }
  body.cp-store-page .store-path-card .store-card-body{
    padding:10px 6px!important;
  }
  body.cp-store-page .store-path-card h2{
    font-size:16px!important;
  }
  body.cp-store-page .store-path-card p{
    font-size:11px!important;
    line-height:1.2!important;
  }
}


/* 5.6.4 - immagini modificabili per i due blocchi percorso Store */
.store-path-image{
  height:150px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fffaf1;
  border-bottom:1px solid #f0dfc5;
  overflow:hidden;
}
.store-path-image img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.store-path-card .store-path-icon{display:none!important;}
@media (max-width:430px){
  body.cp-store-page .store-path-image{
    height:88px!important;
  }
  body.cp-store-page .store-path-image img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
  }
}


/* 5.6.5 - INGRANDISCE DAVVERO LE IMMAGINI DEI 2 RIQUADRI STORE */
body.cp-store-page .store-path-grid{
  max-width:1180px!important;
  gap:22px!important;
}
body.cp-store-page .store-path-card{
  min-height:360px!important;
  overflow:hidden!important;
}
body.cp-store-page .store-path-image{
  height:260px!important;
  min-height:260px!important;
  padding:0!important;
  background:#fffaf1!important;
}
body.cp-store-page .store-path-image img{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain!important;
  transform:scale(1.18)!important;
  transform-origin:center center!important;
}
body.cp-store-page .store-path-card .store-card-body{
  padding:16px 14px!important;
}

@media (max-width:430px){
  body.cp-store-page .store-path-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    max-width:100%!important;
    gap:8px!important;
    padding:0 6px!important;
  }
  body.cp-store-page .store-path-card{
    min-height:235px!important;
    border-radius:16px!important;
  }
  body.cp-store-page .store-path-image{
    height:165px!important;
    min-height:165px!important;
  }
  body.cp-store-page .store-path-image img{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
    transform:scale(1.22)!important;
  }
  body.cp-store-page .store-path-card .store-card-body{
    padding:8px 5px!important;
  }
  body.cp-store-page .store-path-card h2{
    font-size:15px!important;
    line-height:1.05!important;
    margin:0 0 4px!important;
  }
  body.cp-store-page .store-path-card p{
    font-size:10px!important;
    line-height:1.1!important;
    margin:0!important;
  }
}

/* Coffee Point 5.6.8 - Scheda prodotto fullscreen stabile */
.cp-product-clickable{cursor:pointer;}
body.cp-product-modal-open{overflow:hidden!important;}
.cp-product-fullscreen{position:fixed;inset:0;z-index:999999;background:rgba(34,14,6,.72);display:flex;align-items:center;justify-content:center;padding:22px;box-sizing:border-box;}
.cp-product-fullscreen-card{position:relative;width:min(1180px,96vw);max-height:94vh;overflow:auto;background:#fff8ee;border-radius:28px;box-shadow:0 24px 80px rgba(0,0,0,.35);border:1px solid #e3c693;padding:28px;box-sizing:border-box;}
.cp-product-fullscreen-close{position:sticky;top:0;float:right;z-index:2;width:46px;height:46px;border:0;border-radius:999px;background:#351306;color:#fff;font-size:34px;line-height:40px;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.22);}
.cp-product-fullscreen-grid{clear:both;display:grid;grid-template-columns:minmax(360px,1fr) minmax(360px,.9fr);gap:30px;align-items:center;}
.cp-product-fullscreen-image{background:#fff;border-radius:24px;min-height:520px;display:flex;align-items:center;justify-content:center;padding:20px;border:1px solid #eadcc8;box-sizing:border-box;}
.cp-product-fullscreen-image img{width:100%;height:520px;object-fit:contain;border-radius:18px;background:#fff;}
.cp-product-fullscreen-info h2{font-size:34px;line-height:1.12;margin:0 0 18px;color:#2b170c;}
.cp-product-fullscreen-price{font-size:34px;font-weight:900;color:#3a1808;margin:0 0 18px;}
.cp-product-fullscreen-details{font-size:20px;line-height:1.45;color:#3a1808;margin:0 0 22px;}
.cp-product-fullscreen-details p{margin:7px 0;}
.cp-product-fullscreen-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;}
.cp-product-fullscreen-actions .qty-input{width:94px;height:48px;font-size:20px;text-align:center;}
@media(max-width:430px){.cp-product-fullscreen{padding:0;align-items:stretch;}.cp-product-fullscreen-card{width:100vw;max-height:100vh;min-height:100vh;border-radius:0;padding:14px;}.cp-product-fullscreen-grid{display:block;}.cp-product-fullscreen-image{min-height:45vh;padding:8px;border-radius:18px;}.cp-product-fullscreen-image img{height:42vh;}.cp-product-fullscreen-info h2{font-size:24px;margin-top:14px;}.cp-product-fullscreen-price{font-size:28px;}.cp-product-fullscreen-details{font-size:17px;}.cp-product-fullscreen-close{width:42px;height:42px;font-size:30px;line-height:38px;}}

/* 5.7.0 PWA install popup */
#cpPwaInstallBox{position:fixed;left:0;right:0;bottom:18px;z-index:999999;display:flex;justify-content:center;padding:0 14px;box-sizing:border-box;font-family:inherit}
#cpPwaInstallBox .cp-pwa-card{position:relative;display:flex;gap:14px;align-items:center;max-width:520px;width:100%;background:#fff8e9;border:1px solid #d5a24a;border-radius:22px;padding:14px 16px;box-shadow:0 16px 50px rgba(0,0,0,.28);color:#2b160d}
#cpPwaInstallBox img{width:64px;height:64px;border-radius:16px;flex:0 0 auto;box-shadow:0 5px 16px rgba(0,0,0,.16)}
#cpPwaInstallBox b{display:block;font-size:18px;margin-bottom:3px}
#cpPwaInstallBox p{margin:0 0 10px;font-size:14px;line-height:1.25}
#cpPwaInstallBox .cp-pwa-install{background:#2b160d;color:#fff;border:0;border-radius:999px;padding:10px 16px;font-weight:800;cursor:pointer}
#cpPwaInstallBox .cp-pwa-close{position:absolute;right:10px;top:8px;border:0;background:transparent;font-size:24px;line-height:1;color:#2b160d;cursor:pointer}
#cpPwaInstallBox small{display:block;margin-top:8px;font-weight:700;color:#5a311e}
@media(max-width:430px){#cpPwaInstallBox{bottom:12px}#cpPwaInstallBox .cp-pwa-card{border-radius:18px;padding:12px 14px}#cpPwaInstallBox img{width:54px;height:54px}#cpPwaInstallBox b{font-size:16px}#cpPwaInstallBox p{font-size:12px}}


/* === 5.7.9 HOME PC FULLSCREEN + NO PWA POPUP DESKTOP === */
@media (min-width:901px){
  #cpPwaInstallBox{display:none!important;}
  body.cp-home-page,
  body.cp-home-page #page,
  body.cp-home-page .site,
  body.cp-home-page .site-content,
  body.cp-home-page .ast-container,
  body.cp-home-page .content-area,
  body.cp-home-page .entry-content{
    width:100vw!important;max-width:100vw!important;margin:0!important;padding:0!important;overflow-x:hidden!important;
  }
  body.cp-home-page .cp-desktop-home-hero,
  body.cp-home-page section.hero.cp-desktop-home-hero{
    display:block!important;
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    min-height:calc(100vh - 64px)!important;
    height:calc(100vh - 64px)!important;
    aspect-ratio:auto!important;
    background-size:cover!important;
    background-position:center center!important;
    background-repeat:no-repeat!important;
    overflow:hidden!important;
  }
  body.cp-home-page .cp-desktop-home-hero .hero-inner{
    width:100%!important;height:100%!important;min-height:100%!important;aspect-ratio:auto!important;max-width:none!important;margin:0!important;padding:0!important;
  }
}
@media (max-width:900px){
  #cpPwaInstallBox{display:block;}
}
