/* ===========================
   Dolce Vita — Coffee (Premium Italian Gelateria Theme)
   SAFE: selectors/IDs unchanged from coffee.html
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Cormorant+Garamond:wght@500;600;700&family=Lato:wght@300;400;600;700&display=swap');

/* Theme tokens */
:root{
  --cream:#fdf6e3;
  --ivory:#f8f4e8;
  --paper:#fffdf7;

  --forest:#1a5c2a;
  --forest-2:#2d7a3e;
  --forest-dark:#0d2f16;

  --gold:#d4af37;
  --gold-2:#c9a84c;
  --gold-light:#f3e2a9;

  --wine:#8b1a1a;
  --wine-2:#6e1414;

  --ink:#2b2318;
  --muted:#6f6252;
  --stroke: rgba(201,168,76,.4);

  --bg-warm:
    radial-gradient(1200px 620px at 10% -12%, rgba(212,175,55,.14), transparent 60%),
    radial-gradient(1000px 620px at 112% 112%, rgba(26,92,42,.12), transparent 60%),
    linear-gradient(160deg, #fdf6e3 0%, #f8f4e8 45%, #f3ead2 100%);

  --header-grad: linear-gradient(120deg, #08170c 0%, #0d2f16 22%, #1a5c2a 55%, #2d7a3e 78%, #0d2f16 100%);
  --gold-shimmer: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.55) 45%, rgba(255,240,190,.85) 50%, rgba(255,255,255,.55) 55%, transparent 100%);
  --card-bg: linear-gradient(180deg, #fffdf7 0%, #fdf6e3 100%);
  --glass: linear-gradient(180deg, rgba(255,255,255,.7), rgba(253,246,227,.55));

  --shadow-sm: 0 6px 18px rgba(26,92,42,.14);
  --shadow-lg: 0 22px 48px rgba(13,47,22,.22);
  --shadow-gold: 0 0 0 1px rgba(212,175,55,.5), 0 10px 26px rgba(212,175,55,.25);

  --radius: 14px;
  --radius-sm: 10px;

  --t1:.25s;
  --t2:.5s;
}

/* Reset */
*{ margin:0; padding:0; box-sizing:border-box; }

/* Italian flag animated strip (top of every page) */
.italia-strip{
  width:100%;
  height:6px;
  background: repeating-linear-gradient(90deg,
    #009246 0 40px, #ffffff 40px 80px, #ce2b37 80px 120px);
  background-size:120px 100%;
  animation: italiaFlow 6s linear infinite;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
@keyframes italiaFlow{
  from{ background-position: 0 0; }
  to{ background-position: -120px 0; }
}
@media (prefers-reduced-motion: reduce){ .italia-strip{ animation:none; } }

/* Page */
body{
  font-family:'Lato', sans-serif;
  line-height:1.6;
  color:var(--ink);
  background: var(--bg-warm);
  background-attachment: fixed;
  min-height:100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3{ font-family:'Playfair Display', serif; letter-spacing:.02em; }

/* Ambient drift like gelato */
@keyframes bgFloat {
  0% { background-position: 0% 0%, 100% 100%, 0 0; }
  50%{ background-position: 18% -8%, 84% 112%, 0 0; }
  100%{ background-position: 0% 0%, 100% 100%, 0 0; }
}
body{ animation: bgFloat 30s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce){ body{ animation:none; } }

/* Header / Footer */
header, footer{
  position:relative;
  text-align:center;
  padding:14px 5px;
  background: var(--header-grad);
  color: var(--gold-light);
  border-bottom:2px solid var(--gold-2);
  overflow:hidden;
}
footer{
  border-top:2px solid var(--gold-2);
  border-bottom:none;
  font-family:'Cormorant Garamond', serif;
  font-size:1.1em;
  letter-spacing:.03em;
}

/* Small "site by" credit line inside the footer */
.site-credit{
  margin-top:4px;
  font-family:'Cormorant Garamond', serif;
  font-style:italic;
  font-size:.75em;
  letter-spacing:.03em;
  opacity:.8;
}
.site-credit a{
  color: var(--gold-light);
  text-decoration:none;
  border-bottom:1px solid rgba(243,226,169,.35);
  transition: opacity var(--t1) ease, border-color var(--t1) ease;
}
.site-credit a:hover{
  opacity:1;
  border-color: rgba(243,226,169,.85);
}

header::after{
  content:"";
  position:absolute;
  top:0; left:-60%;
  width:60%; height:100%;
  background: var(--gold-shimmer);
  animation: headerShimmer 6s ease-in-out infinite;
  pointer-events:none;
  z-index:1;
}
@keyframes headerShimmer{
  0%{ left:-60%; }
  55%{ left:120%; }
  100%{ left:120%; }
}
@media (prefers-reduced-motion: reduce){ header::after{ animation:none; display:none; } }

/* Logo (cream glow backdrop so the mark reads cleanly on the green banner) */
.logo{
  position:relative;
  z-index:2;
  display:inline-block;
}
.logo::before{
  content:"";
  position:absolute;
  inset:-16px;
  background: radial-gradient(circle, rgba(255,255,255,.98) 0%, rgba(255,253,247,.85) 50%, rgba(253,246,227,.55) 68%, transparent 82%);
  border-radius:50%;
  z-index:-1;
  box-shadow: 0 0 42px rgba(212,175,55,.4);
}
.logo img{
  max-width:230px; height:auto;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.45));
  transition: transform var(--t1) ease;
  position:relative;
}
.logo a:hover img{ transform: scale(1.03); }

/* ---- Nav cart icon + badge (top-right of header) ---- */
.nav-cart-link{
  position:absolute;
  top:14px;
  right:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border-radius:50%;
  background: rgba(253,246,227,.18);
  border:1px solid rgba(212,175,55,.55);
  text-decoration:none;
  font-size:22px;
  z-index:5;
  transition: transform var(--t1) ease, background var(--t1) ease, box-shadow var(--t1) ease;
}
.nav-cart-link:hover{
  transform: translateY(-2px) scale(1.06);
  background: rgba(253,246,227,.3);
  box-shadow: 0 8px 18px rgba(0,0,0,.3);
}
.nav-cart-link:active{ transform: translateY(0) scale(.94); }
.nav-cart-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  border-radius:9px;
  background: linear-gradient(135deg, var(--wine), var(--wine-2));
  color: var(--gold-light);
  font-size:11px;
  font-weight:800;
  line-height:18px;
  text-align:center;
  border:1px solid var(--gold-2);
  display:none;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* Top buttons container */
.center-container{ display:flex; justify-content:center; gap:14px; margin-top:20px; flex-wrap:wrap; }

/* Buttons (match gelato) */
.big-green-button,
.big-red-button {
  position:relative;
  display:inline-block;
  width:200px;
  padding:20px;
  color:var(--gold-light);
  text-align:center;
  border:1px solid var(--gold-2);
  border-radius:var(--radius);
  font-size:20px;
  font-weight:800;
  font-family:'Playfair Display', serif;
  margin:10px;
  cursor:pointer;
  text-decoration:none;
  overflow:hidden;
  box-shadow: var(--shadow-lg);
  transition: transform var(--t1) ease, filter var(--t1) ease, box-shadow var(--t1) ease;
}
.big-green-button{
  background: linear-gradient(145deg, var(--forest-dark) 0%, var(--forest) 45%, var(--forest-2) 70%, var(--forest-dark) 100%);
}
.big-red-button{
  background: linear-gradient(145deg, var(--wine-2) 0%, var(--wine) 50%, var(--wine-2) 100%);
}
.big-green-button:hover,
.big-red-button:hover{
  transform: translateY(-3px) scale(1.03);
  filter: brightness(1.08);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
}
.big-green-button:active,
.big-red-button:active{ transform: translateY(-1px) scale(.99); }

.big-green-button::after,
.big-red-button::after{
  content:"";
  position:absolute;
  top:0; left:-75%;
  width:50%; height:100%;
  background: var(--gold-shimmer);
  transform: skewX(-20deg);
}
.big-green-button:hover::after,
.big-red-button:hover::after{
  animation: btnShimmer 1.1s ease forwards;
}
@keyframes btnShimmer{
  from{ left:-75%; }
  to{ left:135%; }
}

/* Coffee grid (mirror gelato responsiveness) */
.coffee-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap:22px;
  padding:20px;
}

@keyframes cardIn{
  from{ opacity:0; transform: translateY(22px) scale(.98); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}

/* Coffee cards */
.coffee-card{
  position:relative;
  border:1px solid var(--stroke);
  text-align:center;
  padding:16px;
  border-radius:var(--radius);
  background: var(--card-bg);
  cursor:pointer;
  text-decoration:none;
  overflow:hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t2) ease, box-shadow var(--t2) ease, border-color var(--t2) ease;
  animation: cardIn .6s ease both;
}
.coffee-grid .coffee-card:nth-child(1){ animation-delay:.02s; }
.coffee-grid .coffee-card:nth-child(2){ animation-delay:.08s; }
.coffee-grid .coffee-card:nth-child(3){ animation-delay:.14s; }
.coffee-grid .coffee-card:nth-child(4){ animation-delay:.2s; }
.coffee-grid .coffee-card:nth-child(5){ animation-delay:.26s; }
.coffee-grid .coffee-card:nth-child(6){ animation-delay:.32s; }
.coffee-grid .coffee-card:nth-child(n+7){ animation-delay:.36s; }

.coffee-card:hover{
  transform: translateY(-6px) scale(1.015);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border-color: var(--gold);
}
.coffee-card:active{ transform: translateY(-3px) scale(1.005); }

/* Gloss sheen sweep on hover */
.coffee-card::before{
  content:"";
  position:absolute;
  top:0; left:-60%;
  width:40%; height:100%;
  background: var(--gold-shimmer);
  transform: skewX(-20deg);
  pointer-events:none;
  z-index:1;
}
.coffee-card:hover::before{ animation: cardSheen 1s ease forwards; }
@keyframes cardSheen{ from{ left:-60%; } to{ left:140%; } }

.coffee-card img{
  width:100%; height:200px; object-fit:cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 22px rgba(13,47,22,.2);
  transition: transform var(--t2) ease;
}
.coffee-card:hover img{ transform: scale(1.04); }
.coffee-card h3{
  color: var(--forest-dark);
  margin-top:12px;
  font-weight:700;
  transition: color var(--t1) ease;
}

/* "Steps" box */
.steps-container{
  background: var(--card-bg);
  border:1px solid var(--stroke);
  border-radius:var(--radius-sm);
  padding:20px;
  margin-top:20px;
  box-shadow: var(--shadow-sm);
}
.step{ margin-bottom:20px; border-bottom:1px solid var(--stroke); padding-bottom:10px; animation: itemIn .4s ease both; }
.step-number{
  background: linear-gradient(135deg,var(--gold-2),var(--gold));
  color:var(--forest-dark); padding:5px 10px; border-radius:50%; font-weight:800; display:inline-block; margin-right:10px;
}
.step-description{ font-style:italic; line-height:1.7; color:var(--muted); }

/* Coffee link button (if used on this page) */
.coffee-link-button{
  display:inline-block;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color:var(--forest-dark);
  text-align:center;
  padding:10px 20px;
  border-radius:10px;
  text-decoration:none;
  font-size:16px;
  font-weight:bold;
  cursor:pointer;
  border:1px solid var(--gold-2);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t1) ease, filter var(--t1) ease, box-shadow var(--t1) ease;
}
.coffee-link-button:hover{ transform: translateY(-2px) scale(1.02); filter: brightness(1.05); box-shadow: var(--shadow-gold); }
.coffee-link-button:active{ transform: translateY(0) scale(.98); }

/* Instructions */
#instructions{
  background: linear-gradient(90deg, rgba(26,92,42,.1), rgba(255,255,255,.5), rgba(212,175,55,.16));
  border:1px solid var(--stroke);
  border-radius:var(--radius-sm);
  padding:12px;
  margin:15px 0;
  width:auto;
  box-shadow: var(--shadow-sm);
  color:var(--ink);
  animation: fadeIn .7s ease both, moveUp .7s ease both;
}
#instructions h3{ margin-bottom:10px; font-size:19px; color:var(--forest-dark); }
#instructions ul{ list-style-type:none; padding-left:20px; }
#instructions li{ margin-bottom:5px; font-size:14px; color:var(--muted); }

/* Cart (match gelato) */
#cart-container{
  background: var(--glass);
  border:1px solid var(--stroke);
  padding:20px;
  border-radius:var(--radius);
  margin:20px 0;
  box-shadow: var(--shadow-sm);
  font-family:'Lato', sans-serif;
  animation: fadeIn .7s ease both, moveUp .7s ease both;
}
#cart-header h1{
  font-size:1.6em; color:var(--forest-dark); margin:0 0 20px 0; text-align:left;
  border-bottom:2px solid var(--gold-2); padding-bottom:10px;
}
#cart-items{ list-style-type:none; padding:0; margin:0; }
#cart-items li{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 0; border-bottom:1px solid var(--stroke);
  transition: background-color var(--t2);
  font-size:1em;
  animation: itemIn .4s ease both;
}
#cart-items li:last-child{ border-bottom:none; }
#cart-items li:hover{ background-color: rgba(212,175,55,.08); }
@keyframes itemIn{
  from{ opacity:0; transform: translateX(-10px); }
  to{ opacity:1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce){ #cart-items li{ animation:none; } }
#cart-items button{
  margin-left:10px; background: linear-gradient(135deg,var(--wine),var(--wine-2));
  color:var(--gold-light); border:1px solid var(--gold-2); padding:8px 20px; border-radius:20px; cursor:pointer; font-size:.9em;
  transition: transform var(--t1) ease, filter var(--t1) ease;
  box-shadow: 0 6px 14px rgba(139,26,26,.25);
}
#cart-items button:hover{ transform: translateY(-1px); filter: brightness(1.1); }
#cart-items button:active{ transform: translateY(0) scale(.94); }
#cart-items .item-name{ flex-grow:1; font-weight:700; color:var(--ink); margin-right:15px; }
#cart-items .item-price, #cart-items .item-quantity{ color:var(--muted); font-size:.9em; }

/* Hidden menu items stay hidden */
#menu-items{ display:none; }

/* Go to Checkout button (shown only when cart has items) */
.go-to-checkout-btn{
  display:block;
  margin-top:16px;
  width:100%;
  text-align:center;
  padding:14px;
  border-radius:var(--radius-sm);
  background: linear-gradient(135deg, var(--forest), var(--forest-2));
  color:#fff;
  border:1px solid var(--gold-2);
  font-weight:700;
  font-family:'Playfair Display', serif;
  font-size:1.1em;
  text-decoration:none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t1) ease, filter var(--t1) ease, box-shadow var(--t1) ease;
}
.go-to-checkout-btn:hover{
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: var(--shadow-gold);
}
.go-to-checkout-btn:active{ transform: translateY(0) scale(.98); }

/* Select dropdowns (size/flavor pickers) */
.selector{
  margin-top:20px; padding:12px; font-size:1.1em; width:100%;
  color:var(--ink); background:var(--paper); border:2px solid var(--stroke); border-radius:var(--radius-sm);
  outline:none;
  font-family:'Lato', sans-serif;
  transition: border-color var(--t1) ease, box-shadow var(--t1) ease;
}
.selector:focus{ border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.2); }
.selector option:disabled{ color:#b9ad93; }

/* Dark modal overrides (beats inline JS styles) */
.modal {
  background: rgba(13,47,22,0.55) !important;
  backdrop-filter: blur(8px);
}

.modal > div {
  background: var(--card-bg) !important;
  color: var(--ink) !important;
  border: 2px solid var(--gold-2) !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(13,47,22,.4), var(--shadow-gold) !important;
  animation: modalPop .35s cubic-bezier(.34,1.4,.64,1) both;
}
@keyframes modalPop{
  from{ opacity:0; transform: translateY(14px) scale(.96); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce){ .modal > div{ animation:none; } }

/* Headings/text inside modal */
.modal > div h2 {
  color: var(--forest-dark) !important;
  font-family:'Playfair Display', serif;
  margin: 0 0 12px;
  font-weight: 800;
}

/* Make the dropdowns match the theme and fill width */
.modal .selector {
  width: 100%;
  margin-top: 12px;
  background: var(--paper) !important;
  color: var(--ink) !important;
  border: 2px solid var(--stroke) !important;
  border-radius: 8px;
}

.modal .selector option {
  background: var(--paper);
  color: var(--ink);
}

.modal .close-button {
  color: var(--gold-light) !important;
}

/* Generic buttons inside modal (Add to Cart / Select) */
.modal > div button{
  background: linear-gradient(135deg, var(--forest), var(--forest-2)) !important;
  color: #fff !important;
  border: 1px solid var(--gold-2) !important;
  border-radius: 10px !important;
  cursor:pointer;
  font-weight:700;
  transition: transform var(--t1) ease, filter var(--t1) ease, box-shadow var(--t1) ease;
  box-shadow: var(--shadow-sm);
}
.modal > div button:hover{
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: var(--shadow-gold);
}
.modal > div button:active{
  transform: translateY(0) scale(.96);
}
.modal > div .close-button{
  background: linear-gradient(135deg,var(--wine),var(--wine-2)) !important;
}

/* Credits */
#credits{
  text-align:center; margin:10px 0; font-size:16px;
  background: linear-gradient(90deg, rgba(26,92,42,.12), rgba(255,255,255,.5), rgba(212,175,55,.16));
  color:var(--ink); padding:10px 15px; border-radius:10px;
  animation: fadeIn 1.2s ease both, moveUp 1.2s ease both;
  border:1px solid var(--stroke);
}
#credits a{
  color:var(--forest); text-decoration:none; font-weight:bold;
  transition: filter var(--t1) ease, transform var(--t1) ease;
}
#credits a:hover{ filter:brightness(1.3); transform: translateY(-1px); }

/* Animations (shared) */
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }
@keyframes moveUp{ from{ transform: translateY(20px) } to{ transform: translateY(0) } }

/* ---------- Responsive like gelato ---------- */
@media (max-width: 600px){
  body{ padding:10px; }
  h1,h2,h3{ font-size:1.5em; }
  .coffee-grid{ grid-template-columns:1fr; gap:15px; }
  .coffee-card{ padding:10px; }
  input[type="text"]{ width:100%; }
  .center-container{ margin-top:10px; }
  .nav-cart-link{ top:10px; right:10px; width:38px; height:38px; font-size:19px; }
}
@media (min-width:601px) and (max-width:1024px){
  body{ padding:15px; }
  h1,h2,h3{ font-size:1.75em; }
  .coffee-grid{ grid-template-columns: repeat(2,1fr); gap:20px; }
  .coffee-card{ padding:15px; }
}
@media (min-width:1025px) and (max-width:1440px){
  .coffee-grid{ grid-template-columns: repeat(3,1fr); gap:20px; }
  .coffee-card{ padding:15px; }
}
@media (min-width:1441px){
  .coffee-grid{ grid-template-columns: repeat(4,1fr); gap:25px; }
  .coffee-card{ padding:20px; }
}
