/* ============================================================
   Idealwine, Srl — WooCommerce-style budget e-commerce template
   ============================================================ */

:root {
  --woo-purple: #96588a;
  --woo-purple-dark: #7b4770;
  --sale-red: #e2401c;
  --sale-green: #7fad7f;
  --bg: #f7f6f7;
  --white: #ffffff;
  --text: #333333;
  --muted: #777777;
  --border: #e0e0e0;
  --banner-yellow: #fff3cd;
  --banner-blue: #d1ecf1;
  --font: Arial, Helvetica, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }

a { color: var(--woo-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1200px, 96%); margin: 0 auto; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.top-bar {
  background: var(--woo-purple-dark);
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-bar a { color: #fff; }
.top-bar-left, .top-bar-right { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- Header ---------- */
.site-header { background: var(--white); border-bottom: 3px solid var(--woo-purple); box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; flex-wrap: wrap; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--woo-purple); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-icon { width: 42px; height: 42px; background: var(--woo-purple); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; border-radius: 4px; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 12px; color: var(--text); font-weight: 600; font-size: 13px; text-transform: uppercase; }
.main-nav a:hover { color: var(--woo-purple); text-decoration: none; background: #f5f0f4; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.search-box { display: flex; border: 2px solid var(--border); border-radius: 3px; overflow: hidden; }
.search-box input { border: none; padding: 8px 10px; width: 160px; font-size: 13px; outline: none; }
.search-box button { background: var(--woo-purple); color: #fff; border: none; padding: 8px 12px; cursor: pointer; font-size: 13px; }

.cart-btn { background: var(--sale-red); color: #fff; padding: 8px 14px; border-radius: 3px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.cart-btn:hover { background: #c9302c; text-decoration: none; color: #fff; }

/* Language switch — fixed top-right, prominent */
.lang-switch { position: relative; z-index: 110; }
.lang-switch-btn {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 3px solid var(--woo-purple);
  color: var(--woo-purple-dark); font-weight: 800; font-size: 15px;
  padding: 8px 14px; cursor: pointer; border-radius: 4px;
  min-width: 110px; justify-content: space-between;
  box-shadow: 0 2px 6px rgba(150,88,138,0.35);
}
.lang-switch-btn:hover { background: #fdf5fb; }
.lang-switch-btn .arrow { font-size: 10px; }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  background: #fff; border: 3px solid var(--woo-purple); border-radius: 4px;
  min-width: 160px; box-shadow: 0 6px 20px rgba(0,0,0,0.15); overflow: hidden;
}
.lang-dropdown.open { display: block; }
.lang-dropdown button {
  display: block; width: 100%; text-align: left; padding: 12px 16px;
  border: none; background: #fff; cursor: pointer; font-size: 14px; font-weight: 700;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.lang-dropdown button:last-child { border-bottom: none; }
.lang-dropdown button:hover { background: #fdf5fb; color: var(--woo-purple); }
.lang-dropdown button.active { background: var(--woo-purple); color: #fff; }
.lang-dropdown button .lang-label { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.lang-dropdown button.active .lang-label { color: rgba(255,255,255,0.85); }

.menu-toggle { display: none; background: var(--woo-purple); color: #fff; border: none; padding: 10px 14px; font-size: 18px; cursor: pointer; border-radius: 3px; }

/* ---------- Promo ticker ---------- */
.promo-ticker { background: var(--sale-red); color: #fff; text-align: center; padding: 8px 12px; font-weight: 700; font-size: 13px; animation: tickerPulse 2s infinite; }
@keyframes tickerPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.85; } }

/* ---------- Banners ---------- */
.banner-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px auto; }
.banner {
  padding: 20px 16px; text-align: center; font-weight: 700; font-size: 14px;
  border: 2px dashed var(--border); border-radius: 4px; cursor: pointer;
  transition: transform 0.15s;
}
.banner:hover { transform: scale(1.02); }
.banner-1 { background: linear-gradient(135deg, #fff3cd, #ffe69c); color: #856404; }
.banner-2 { background: linear-gradient(135deg, #d1ecf1, #bee5eb); color: #0c5460; }
.banner-3 { background: linear-gradient(135deg, #f8d7da, #f5c6cb); color: #721c24; }
.banner-large {
  background: linear-gradient(90deg, var(--woo-purple), var(--woo-purple-dark));
  color: #fff; padding: 28px 20px; text-align: center; margin: 10px auto;
  border-radius: 4px; font-size: 18px; font-weight: 700;
}
.banner-large .sub { font-size: 13px; font-weight: 400; margin-top: 6px; opacity: 0.9; }

.hero-slider { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin: 10px auto; }
.hero-main {
  background: #2c2c2c url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23333" width="100" height="100"/><text x="50" y="55" text-anchor="middle" fill="%23666" font-size="12">WINE</text></svg>') center/cover;
  min-height: 220px; display: flex; align-items: flex-end; padding: 20px; color: #fff;
  border-radius: 4px; position: relative;
}
.hero-main::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,0.7)); border-radius: 4px; }
.hero-main .hero-text { position: relative; z-index: 1; }
.hero-main h1 { font-size: 26px; margin-bottom: 6px; }
.hero-side { display: flex; flex-direction: column; gap: 8px; }
.hero-side-ad { flex: 1; background: var(--banner-yellow); padding: 16px; border: 2px solid #ffc107; border-radius: 4px; font-weight: 700; font-size: 13px; text-align: center; display: grid; place-items: center; }

/* ---------- Layout ---------- */
.content-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin: 12px auto; align-items: start; }

.sidebar {
  background: var(--white); border: 1px solid var(--border); border-radius: 4px;
  padding: 0; font-size: 13px;
}
.sidebar h3 { background: var(--woo-purple); color: #fff; padding: 10px 12px; font-size: 13px; text-transform: uppercase; }
.sidebar ul { list-style: none; }
.sidebar li a { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 600; }
.sidebar li a:hover { background: #f5f0f4; text-decoration: none; color: var(--woo-purple); }
.sidebar-ad { margin-top: 8px; background: #e8f5e9; border: 2px solid var(--sale-green); padding: 14px; text-align: center; font-weight: 700; font-size: 12px; border-radius: 4px; }

.main-content { min-width: 0; }

.section-title {
  background: var(--white); border-left: 4px solid var(--woo-purple);
  padding: 10px 14px; margin-bottom: 10px; font-size: 16px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.section-title a { font-size: 12px; font-weight: 600; }

/* ---------- Product grid — high density ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 4px;
  padding: 10px; position: relative; transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.product-badge { position: absolute; top: 8px; left: 8px; background: var(--sale-red); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 2px; }
.product-img {
  height: 100px; background: #eee; margin-bottom: 8px; display: grid; place-items: center;
  font-size: 36px; border-radius: 3px;
}
.product-card h4 { font-size: 12px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; min-height: 32px; }
.product-price { color: var(--sale-red); font-weight: 800; font-size: 15px; }
.product-price del { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 4px; }
.product-card .add-btn {
  display: block; width: 100%; margin-top: 8px; background: var(--woo-purple); color: #fff;
  border: none; padding: 7px; font-size: 11px; font-weight: 700; cursor: pointer; border-radius: 3px; text-transform: uppercase;
}
.product-card .add-btn:hover { background: var(--woo-purple-dark); }

/* ---------- Info blocks ---------- */
.info-dense { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.info-box { background: var(--white); border: 1px solid var(--border); padding: 14px; border-radius: 4px; font-size: 12px; }
.info-box h3 { font-size: 14px; color: var(--woo-purple); margin-bottom: 6px; }
.info-box p { color: var(--muted); line-height: 1.5; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat-box { background: var(--woo-purple); color: #fff; text-align: center; padding: 14px 8px; border-radius: 4px; }
.stat-box .num { font-size: 22px; font-weight: 800; }
.stat-box .lbl { font-size: 11px; opacity: 0.9; margin-top: 2px; }

.contact-dense { background: var(--white); border: 1px solid var(--border); padding: 16px; border-radius: 4px; margin-bottom: 14px; }
.contact-dense h3 { color: var(--woo-purple); margin-bottom: 10px; font-size: 15px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-list-d { list-style: none; font-size: 13px; }
.contact-list-d li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.contact-form-d input, .contact-form-d textarea {
  width: 100%; padding: 8px; border: 1px solid var(--border); margin-bottom: 8px; font-size: 13px; font-family: inherit;
}
.contact-form-d button { background: var(--sale-red); color: #fff; border: none; padding: 10px 20px; font-weight: 700; cursor: pointer; width: 100%; }

.inline-ad { background: var(--banner-blue); border: 2px solid #17a2b8; padding: 12px; text-align: center; font-weight: 700; margin: 10px 0; border-radius: 4px; font-size: 13px; }

/* ---------- Footer — dense ---------- */
.site-footer { background: #2c2c2c; color: #ccc; margin-top: 16px; font-size: 12px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 24px 0; }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; margin-bottom: 10px; border-bottom: 2px solid var(--woo-purple); padding-bottom: 6px; display: inline-block; }
.footer-col a { display: block; color: #aaa; padding: 4px 0; font-size: 12px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #444; padding: 12px 0; text-align: center; color: #888; font-size: 11px; }

/* ---------- Popup promo ---------- */
.popup-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.popup-overlay.show { display: flex; }
.popup-box {
  background: #fff; max-width: 420px; width: 100%; border-radius: 6px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3); position: relative; animation: popIn 0.3s ease;
}
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popup-header { background: var(--sale-red); color: #fff; padding: 20px; text-align: center; }
.popup-header h2 { font-size: 24px; margin-bottom: 4px; }
.popup-header p { font-size: 14px; opacity: 0.95; }
.popup-body { padding: 20px; text-align: center; }
.popup-code { background: #fff3cd; border: 2px dashed #ffc107; padding: 12px; font-size: 22px; font-weight: 800; color: var(--sale-red); margin: 12px 0; letter-spacing: 2px; }
.popup-body .popup-btn { background: var(--woo-purple); color: #fff; border: none; padding: 12px 24px; font-weight: 700; font-size: 14px; cursor: pointer; width: 100%; border-radius: 4px; margin-top: 8px; }
.popup-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .content-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-slider { grid-template-columns: 1fr; }
  .banner-row { grid-template-columns: 1fr; }
  .info-dense, .stats-row, .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .main-nav.mobile-open { display: flex; flex-direction: column; width: 100%; order: 10; }
}
@media (max-width: 560px) {
  .product-grid, .info-dense, .stats-row, .footer-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
}
