/* ============================================================
   Dr. Lilly — store theme
   Palette:  --hot-pink #E6127D   (primary / logo pink)
             --deep-pink #A80A5C (hover / pressed)
             --blush #FFF3F8      (page background)
             --gold #FFB100       (count badge / highlights)
             --ink #2B1830        (text)
             --ink-soft #8A7686   (secondary text)
   Type:     'Quicksand' — rounded UI/body face
             'Pacifico'  — script accent, used sparingly (page title, empty state)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Pacifico&display=swap');

:root {
  --hot-pink: #E6127D;
  --deep-pink: #A80A5C;
  --blush: #FFF3F8;
  --blush-deep: #FFE3EF;
  --gold: #FFB100;
  --ink: #2B1830;
  --ink-soft: #8A7686;
  --white: #FFFFFF;
  --shadow-pink: 0 10px 28px rgba(230, 18, 125, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--blush);
  color: var(--ink);
}

.site-header {
  background: var(--white);
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--blush-deep);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-actions { display:flex; gap:12px; align-items:center; }

.header-filters { display:flex; gap:8px; align-items:center; margin-left:12px; }
.filter-btn { padding:6px 10px; border-radius:999px; background:#fff; border:1px solid var(--blush-deep); cursor:pointer; font-weight:700; }
.filter-btn.selected { background:var(--hot-pink); color:#fff; box-shadow:var(--shadow-pink); }
.badge { background: var(--hot-pink); color:#fff; padding:2px 6px; border-radius:6px; font-size:12px; margin-left:6px; }

#language-select {
  background: var(--blush);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid var(--blush-deep);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 13px;
}

.logo {
  font-family: 'Pacifico', cursive;
  font-size: 26px;
  font-weight: 400;
  color: var(--hot-pink);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}
.logo img {
  height: 64px;
  width: auto;
  display: block;
}

/* Slightly smaller logo on narrow screens */
@media (max-width: 480px) {
  .logo img { height: 48px; }
}

.cart-toggle {
  background: var(--hot-pink);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-pink);
  transition: background 0.15s ease, transform 0.15s ease;
}
.cart-toggle:hover { background: var(--deep-pink); transform: translateY(-1px); }
.cart-count {
  background: var(--gold);
  color: var(--ink);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 36px 20px 80px; }

.page-title {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  font-size: 34px;
  color: var(--hot-pink);
  margin: 0 0 28px;
  text-align: center;
  position: relative;
  padding-bottom: 16px;
}
/* signature flourish under the title, echoing the swash under the logo's "Dr." */
.page-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 8 Q 20 -2, 38 8 T 74 8 T 110 8' stroke='%23E6127D' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.product-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(43, 24, 48, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid var(--blush-deep);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pink);
  border-color: var(--hot-pink);
}
.product-image {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--blush);
}
.product-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.product-desc { font-size: 13px; color: var(--ink-soft); flex: 1; line-height: 1.5; }
.product-price { font-weight: 700; font-size: 17px; margin-top: 4px; color: var(--hot-pink); }
.add-btn {
  margin-top: 8px;
  background: var(--hot-pink);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.add-btn:hover { background: var(--deep-pink); transform: translateY(-1px); }

.empty-msg {
  color: var(--ink-soft);
  text-align: center;
  margin-top: 60px;
  font-size: 16px;
}

/* Cart Sidebar */
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(43, 24, 48, 0.35);
  z-index: 30;
}
.cart-overlay.active { display: block; }

.cart-sidebar {
  position: fixed; top: 0; right: -380px;
  width: 360px; height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(43, 24, 48, 0.18);
  z-index: 40;
  display: flex; flex-direction: column;
  transition: right 0.25s ease;
}
.cart-sidebar.open { right: 0; }

.cart-header, .checkout-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 2px solid var(--blush);
}
.cart-header h2, .checkout-header h2 {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  color: var(--hot-pink);
  font-size: 22px;
  margin: 0;
}
.icon-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink-soft); }
.icon-btn:hover { color: var(--hot-pink); }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-item {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--blush);
}
.cart-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 10px; background: var(--blush); }
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.cart-item-price { font-size: 13px; color: var(--ink-soft); }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-controls button {
  width: 24px; height: 24px; border: 1px solid var(--blush-deep); background: var(--blush);
  border-radius: 999px; cursor: pointer; color: var(--hot-pink); font-weight: 700;
}
.qty-controls button:hover { background: var(--hot-pink); color: #fff; }
.remove-item { background: none; border: none; color: var(--hot-pink); cursor: pointer; font-size: 13px; font-weight: 600; }

.cart-footer { padding: 16px 20px; border-top: 2px solid var(--blush); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; font-size: 17px; color: var(--ink); }
#cart-total-amount { color: var(--hot-pink); }

.primary-btn {
  width: 100%; background: var(--hot-pink); color: #fff; border: none;
  padding: 13px; border-radius: 999px; font-size: 15px; cursor: pointer;
  font-family: 'Quicksand', sans-serif; font-weight: 700;
  box-shadow: var(--shadow-pink);
  transition: background 0.15s ease, transform 0.15s ease;
}
.primary-btn:disabled { background: #E9DCE3; color: #A899A2; box-shadow: none; cursor: not-allowed; }
.primary-btn:hover:not(:disabled) { background: var(--deep-pink); transform: translateY(-1px); }

/* Checkout Modal */
.checkout-modal {
  display: none;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 560px; max-width: 94vw; max-height: 90vh; overflow-y: auto;
  background: #fff; border-radius: 22px; z-index: 41;
  box-shadow: 0 16px 50px rgba(43, 24, 48, 0.25);
  border: 1px solid var(--blush-deep);
}
.checkout-modal.open { display: block; }
.checkout-form { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 16px; }
.checkout-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-fields .full-width { grid-column: 1 / -1; }
.checkout-form label {
  font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px;
}
.checkout-form input, .checkout-form textarea {
  font-size: 16px; padding: 13px 14px; border: 1.5px solid var(--blush-deep);
  border-radius: 12px; font-family: 'Quicksand', sans-serif; color: var(--ink);
  background: var(--blush);
}
.checkout-form input:focus, .checkout-form textarea:focus {
  outline: none; border-color: var(--hot-pink); background: #fff;
}
.checkout-summary {
  background: var(--blush); border-radius: 12px; padding: 14px 16px;
  font-size: 14px; line-height: 1.6; color: var(--ink); border: 1px dashed var(--blush-deep);
}
.promo-section { padding: 14px; border: 1px solid var(--blush-deep); border-radius: 12px; background: #fffafc; }
.promo-section > label { margin-bottom: 8px; }
.promo-row { display: flex; gap: 8px; }
.promo-row input { min-width: 0; flex: 1; }
.secondary-btn { border: 1.5px solid var(--hot-pink); border-radius: 12px; padding: 0 16px; background: #fff; color: var(--hot-pink); font: 700 14px 'Quicksand', sans-serif; cursor: pointer; }
.secondary-btn:hover:not(:disabled) { background: var(--blush); }
.secondary-btn:disabled { opacity: .6; cursor: wait; }
.promo-status { min-height: 20px; margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.promo-status.valid { color: #197a45; }
.promo-status.invalid { color: #b42342; }

.payment-methods { margin: 8px 0 12px; }
.payment-heading { font-weight:700; margin-bottom:8px; color:var(--ink); }
.payment-options { display:flex; gap:8px; }
.payment-option {
  padding:10px 14px; border-radius:10px; background:#fff; border:1px solid var(--blush-deep);
  cursor:pointer; font-weight:700; color:var(--ink);
}
.payment-option.selected { border-color:var(--hot-pink); box-shadow:var(--shadow-pink); }
.payment-option.disabled { opacity:0.45; pointer-events:none; }

.success-toast {
  display: none;
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--hot-pink); color: #fff; padding: 13px 22px; border-radius: 999px;
  z-index: 50; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-pink);
}

/* ============================================================
   Newsletter popup (email-for-15%-off)
   ============================================================ */
.newsletter-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(43, 24, 48, 0.45);
  backdrop-filter: blur(2px);
  z-index: 60;
}
.newsletter-overlay.active { display: block; }

.newsletter-popup {
  display: none;
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.94);
  width: 400px; max-width: 92vw;
  background: linear-gradient(180deg, #fff 0%, var(--blush) 100%);
  border-radius: 24px; z-index: 61;
  box-shadow: 0 20px 60px rgba(43, 24, 48, 0.3);
  border: 1px solid var(--blush-deep);
  padding: 26px 26px 24px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.newsletter-popup.active { display: block; opacity: 1; transform: translate(-50%,-50%) scale(1); }

.newsletter-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--ink-soft); line-height: 1; padding: 6px; border-radius: 999px;
}
.newsletter-close:hover { color: var(--hot-pink); background: var(--blush-deep); }

.newsletter-avatar {
  width: 64px; height: 64px; margin: 4px auto 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hot-pink), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: var(--shadow-pink);
  animation: newsletter-bob 2.6s ease-in-out infinite;
}
@keyframes newsletter-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.newsletter-popup h3 {
  font-family: 'Pacifico', cursive;
  font-weight: 400;
  color: var(--hot-pink);
  font-size: 24px;
  margin: 0 0 6px;
}
.newsletter-popup p.newsletter-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input[type="email"] {
  font-size: 15px; padding: 13px 16px; border: 1.5px solid var(--blush-deep);
  border-radius: 999px; font-family: 'Quicksand', sans-serif; color: var(--ink);
  background: #fff; text-align: center;
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--hot-pink); }
.newsletter-fineprint { font-size: 11px; color: var(--ink-soft); margin: 10px 0 0; }
.newsletter-status { min-height: 18px; margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.newsletter-status.invalid { color: #b42342; }

.newsletter-success { display: none; }
.newsletter-success.active { display: block; }
.newsletter-code {
  font-size: 22px; font-weight: 800; letter-spacing: 2px;
  background: var(--blush); color: var(--hot-pink);
  padding: 12px 18px; border-radius: 14px; margin: 6px 0 14px;
  border: 1.5px dashed var(--hot-pink);
}

@media (max-width: 480px) {
  .newsletter-popup { padding: 22px 18px 20px; }
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px 0;
  }
  .header-filters {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .filter-btn { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  #language-select { font-size: 12px; padding: 6px 8px; }
  .cart-toggle { padding: 10px 14px; font-size: 13px; }

  .container { padding: 22px 14px 90px; }
  .page-title { font-size: 26px; margin-bottom: 20px; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }
  .product-image { height: 160px; }
  .product-body { padding: 12px; }
  .product-name { font-size: 14px; }
  .product-desc { font-size: 12px; }
  .add-btn { padding: 12px; font-size: 14px; } /* keep touch target comfortable */

  /* Cart becomes a full-width sheet instead of a 360px sidebar */
  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
  .cart-sidebar.open { right: 0; }

  /* Checkout modal becomes a near full-screen sheet, easier to fill on a phone */
  .checkout-modal {
    top: auto; bottom: 0; left: 0;
    transform: none;
    width: 100%; max-width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
  }
  .cart-header, .checkout-header { padding: 16px 16px; }
  .checkout-form { padding: 18px 16px 24px; gap: 14px; }
  .checkout-fields { grid-template-columns: 1fr; }
  .checkout-fields .full-width { grid-column: auto; }
  .cart-items { padding: 10px 16px; }
  .cart-footer { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }

  .cart-item img { width: 44px; height: 44px; }
  .qty-controls button { width: 30px; height: 30px; font-size: 15px; } /* bigger tap targets */
  .remove-item { font-size: 13px; padding: 4px 0; }

  .payment-options { flex-wrap: wrap; }
  .payment-option { flex: 1 1 auto; text-align: center; padding: 12px 10px; }

  .primary-btn { padding: 15px; font-size: 16px; } /* bigger, easier to tap */

  .success-toast { left: 12px; right: 12px; transform: none; text-align: center; bottom: 16px; }
}
.success-toast.show { display: block; }
.newsletter-campaign-image { width:100%; max-height:190px; object-fit:cover; border-radius:14px; margin-bottom:14px; display:block; }
