/*
Theme Name: Drinklog
Theme URI: https://drinklog.co
Author: Drinklog Team
Author URI: https://drinklog.co
Description: Mobile-first premium alcohol marketplace theme with WooCommerce integration. Thai language optimized. Fully compatible with WordPress 6.9.1 including on-demand block CSS loading via theme.json.
Version: 1.3.2
Requires at least: 6.9
Tested up to: 6.9.1
Requires PHP: 7.4
WC requires at least: 9.0
WC tested up to: 9.8
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: drinklog
Tags: e-commerce, mobile, woocommerce, marketplace, thai, classic-theme
*/

/* ────────────────────────────────────────────────────────────
   CSS VARIABLES
──────────────────────────────────────────────────────────── */
:root {
  --dl-orange:       #FF6B00;
  --dl-orange-light: #FF8C35;
  --dl-orange-pale:  #FFF0E6;
  --dl-yellow:       #FFD600;
  --dl-yellow-light: #FFF9CC;
  --dl-white:        #FFFFFF;
  --dl-gray-100:     #F7F7F7;
  --dl-gray-200:     #EEEEEE;
  --dl-gray-400:     #AAAAAA;
  --dl-gray-600:     #666666;
  --dl-gray-700:     #555555;
  --dl-gray-800:     #333333;
  --dl-red:          #FF3B30;
  --dl-green:        #34C759;
  --dl-shadow-sm:    0 1px 4px rgba(0,0,0,0.08);
  --dl-shadow-md:    0 4px 16px rgba(255,107,0,0.15);
  --dl-radius:       14px;
  --dl-dark:         #1a1a2e;
  --dl-dark2:        #16213e;
}

/* ────────────────────────────────────────────────────────────
   RESET & BASE
──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body.dl-body {
  font-family: 'Noto Sans Thai', 'Sarabun', sans-serif;
  background: var(--dl-gray-100);
  color: var(--dl-gray-800);
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
button, input, select, textarea {
  font-family: inherit;
}

/* ────────────────────────────────────────────────────────────
   LAYOUT WRAPPERS
──────────────────────────────────────────────────────────── */
.dl-page-wrap {
  min-height: 100vh;
  padding-bottom: 70px;
  display: flex;
  flex-direction: column;
}

/* ────────────────────────────────────────────────────────────
   TOPBAR
──────────────────────────────────────────────────────────── */
.dl-topbar {
  background: linear-gradient(135deg, var(--dl-orange) 0%, var(--dl-orange-light) 100%);
  padding: 14px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(255,107,0,0.3);
}
.dl-topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
/* ── LOGO — SVG inline ──────────────────────────────────── */
.dl-logo, .dl-desktop-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.dl-logo svg { height: 26px; width: auto; }
.dl-logo svg *, .dl-desktop-logo svg * { fill: white; }


.dl-topbar-icons { margin-left: auto; display: flex; gap: 8px; }

.dl-icon-btn {
  background: rgba(255,255,255,0.2);
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: white; font-size: 16px;
  position: relative; transition: background 0.2s;
  text-decoration: none;
}
.dl-icon-btn:hover, .dl-icon-btn:active { background: rgba(255,255,255,0.35); }
.dl-icon-btn .dl-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--dl-yellow); color: var(--dl-orange);
  font-size: 10px; font-weight: 800;
  width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ────────────────────────────────────────────────────────────
   SEARCH BAR
──────────────────────────────────────────────────────────── */
.dl-search-bar {
  background: white; border-radius: 22px;
  display: flex; align-items: center;
  padding: 8px 14px; gap: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-decoration: none;
  /* form reset */
  border: none; margin: 0; width: 100%; box-sizing: border-box;
}
.dl-search-bar input[type="search"],
.dl-search-bar input[type="text"] {
  border: none; outline: none; flex: 1;
  font-size: 13px; color: var(--dl-gray-800);
  background: transparent; cursor: text;
  font-family: inherit;
  /* ลบ browser default search styling */
  -webkit-appearance: none;
  appearance: none;
}
.dl-search-bar input[type="search"]::-webkit-search-decoration,
.dl-search-bar input[type="search"]::-webkit-search-cancel-button { display: none; }
.dl-search-bar input::placeholder { color: var(--dl-gray-400); }
.dl-search-icon { color: var(--dl-orange); font-size: 15px; flex-shrink: 0; }

/* ────────────────────────────────────────────────────────────
   BANNER / HERO
──────────────────────────────────────────────────────────── */
.dl-banner-wrap { padding: 12px 16px 0; }
.dl-banner {
  background: linear-gradient(135deg, #FF6B00, #FFD600);
  border-radius: var(--dl-radius);
  padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center;
  position: relative; overflow: hidden; min-height: 120px;
}
.dl-banner::before {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.dl-banner::after {
  content: ''; position: absolute; right: 40px; bottom: -30px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.dl-banner-text h2 {
  color: white; font-size: 18px; font-weight: 800; line-height: 1.3;
}
.dl-banner-text p { color: rgba(255,255,255,0.9); font-size: 12px; margin-top: 4px; }
.dl-banner-btn {
  background: white; color: var(--dl-orange); font-weight: 700;
  border: none; border-radius: 20px; padding: 8px 16px;
  font-size: 12px; margin-top: 10px; cursor: pointer;
  display: inline-block; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dl-banner-emoji { font-size: 56px; z-index: 1; line-height: 1; }
.dl-banner-dots { display: flex; justify-content: center; gap: 5px; margin-top: 8px; }
.dl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dl-gray-200); }
.dl-dot.active { background: var(--dl-orange); width: 18px; border-radius: 3px; }

/* ────────────────────────────────────────────────────────────
   SECTIONS
──────────────────────────────────────────────────────────── */
.dl-section { padding: 14px 16px 0; }
.dl-section-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px;
}
.dl-section-title { font-size: 15px; font-weight: 700; }
.dl-see-all { font-size: 12px; color: var(--dl-orange); font-weight: 600; cursor: pointer; }

/* ────────────────────────────────────────────────────────────
   CATEGORY CHIPS
──────────────────────────────────────────────────────────── */
.dl-cat-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 0 16px 4px; scrollbar-width: none;
}
.dl-cat-scroll::-webkit-scrollbar { display: none; }
.dl-cat-chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: white; border-radius: 12px; padding: 10px 12px;
  min-width: 68px; cursor: pointer; border: 2px solid transparent;
  box-shadow: var(--dl-shadow-sm); transition: all 0.2s; flex-shrink: 0;
  text-decoration: none;
}
.dl-cat-chip.active, .dl-cat-chip:hover {
  border-color: var(--dl-orange); background: var(--dl-orange-pale);
}
.dl-cat-chip .dl-cat-emoji { font-size: 22px; }
.dl-cat-chip .dl-cat-label {
  font-size: 10px; font-weight: 600;
  color: var(--dl-gray-600); white-space: nowrap;
}
.dl-cat-chip.active .dl-cat-label,
.dl-cat-chip:hover .dl-cat-label { color: var(--dl-orange); }

/* ────────────────────────────────────────────────────────────
   FLASH SALE BAR
──────────────────────────────────────────────────────────── */
.dl-flash-bar {
  background: linear-gradient(90deg, var(--dl-orange), #FF4444);
  margin: 12px 16px 0; border-radius: var(--dl-radius);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.dl-flash-title { color: white; font-weight: 800; font-size: 13px; }
.dl-flash-timer { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.dl-timer-box {
  background: rgba(0,0,0,0.25); color: white;
  border-radius: 5px; padding: 2px 6px; font-size: 13px; font-weight: 700;
}
.dl-timer-sep { color: rgba(255,255,255,0.8); font-weight: 700; }

/* ────────────────────────────────────────────────────────────
   PRODUCT GRID & CARDS
──────────────────────────────────────────────────────────── */
.dl-product-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.dl-product-card {
  background: white !important;
  border-radius: var(--dl-radius) !important;
  overflow: hidden !important;
  box-shadow: var(--dl-shadow-sm) !important;
  cursor: pointer !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  position: relative !important;
  display: block !important;
  text-decoration: none !important;
  color: inherit !important;
}
.dl-product-card:active { transform: scale(0.97); }
.dl-product-card:hover { box-shadow: var(--dl-shadow-md); }

.dl-product-img {
  width: 100% !important;
  aspect-ratio: 4/3 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 40px !important;
  position: relative !important;
  background: linear-gradient(135deg, var(--dl-yellow-light), var(--dl-orange-pale)) !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}
.dl-product-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  position: absolute !important;
  inset: 0 !important;
}
.dl-sale-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--dl-red); color: white;
  font-size: 9px; font-weight: 800;
  border-radius: 6px; padding: 2px 6px; z-index: 2;
}
.dl-discount-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--dl-red); color: white;
  font-size: 10px; font-weight: 700;
  border-radius: 6px; padding: 2px 6px; z-index: 2;
}
.dl-product-info { padding: 6px 8px 8px; }
.dl-product-name {
  font-size: 11px; font-weight: 700; color: var(--dl-gray-800);
  line-height: 1.4; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 28px;
}
.dl-product-price {
  display: flex; align-items: center;
  gap: 5px; margin-top: 5px;
  min-height: 28px;
}
.dl-price-now { font-size: 14px; font-weight: 800; color: var(--dl-orange); }
.dl-price-old { font-size: 11px; color: var(--dl-gray-400); text-decoration: line-through; }
.dl-product-bottom {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 5px;
}
.dl-sold-count { font-size: 10px; color: var(--dl-gray-400); }
.dl-stars { color: var(--dl-yellow); font-size: 10px; letter-spacing: -1px; }
.dl-add-to-cart-btn {
  background: var(--dl-orange); color: white; border: none;
  border-radius: 50%; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(255,107,0,0.4);
  transition: background 0.2s;
}
.dl-add-to-cart-btn:active { background: var(--dl-orange-light); }

/* ────────────────────────────────────────────────────────────
   BOTTOM NAVIGATION
──────────────────────────────────────────────────────────── */
.dl-bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: min(430px, 100%);
  background: white;
  display: flex; border-top: 1px solid var(--dl-gray-200);
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.dl-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 10px;
  cursor: pointer; color: var(--dl-gray-400);
  transition: color 0.2s; position: relative;
  text-decoration: none;
}
.dl-nav-item.active, .dl-nav-item:hover { color: var(--dl-orange); }
.dl-nav-icon { font-size: 20px; line-height: 1; }
.dl-nav-label { font-size: 10px; font-weight: 600; margin-top: 3px; }
.dl-nav-dot {
  position: absolute; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--dl-orange); opacity: 0;
}
.dl-nav-item.active .dl-nav-dot { opacity: 1; }

/* ────────────────────────────────────────────────────────────
   PAGE HEADER (inner pages)
──────────────────────────────────────────────────────────── */
.dl-page-header {
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light));
  padding: 16px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 200;
}
.dl-page-header h1 { color: white; font-size: 17px; font-weight: 800; }
.dl-back-btn {
  background: rgba(255,255,255,0.2); border: none; border-radius: 50%;
  width: 36px; height: 36px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: white; font-size: 18px;
}

/* ────────────────────────────────────────────────────────────
   CART PAGE
──────────────────────────────────────────────────────────── */
.dl-cart-block {
  background: white; margin: 10px 16px 0;
  border-radius: var(--dl-radius); overflow: hidden;
  box-shadow: var(--dl-shadow-sm);
}
.dl-cart-shop-name {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-bottom: 1px solid var(--dl-gray-100);
  font-size: 13px; font-weight: 700;
}
.dl-cart-item {
  display: flex; align-items: center;
  gap: 12px; padding: 12px 14px;
}
.dl-cart-item-img {
  width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0;
  overflow: hidden; background: var(--dl-orange-pale);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.dl-cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.dl-cart-item-info { flex: 1; }
.dl-cart-item-name { font-size: 12px; font-weight: 600; line-height: 1.4; }
.dl-cart-item-variant { font-size: 11px; color: var(--dl-gray-400); margin-top: 2px; }
.dl-cart-item-price-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-top: 6px;
}
.dl-cart-price { font-size: 14px; font-weight: 800; color: var(--dl-orange); }
.dl-qty-control { display: flex; align-items: center; gap: 8px; }
.dl-qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--dl-gray-200); background: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; color: var(--dl-orange); font-weight: 700;
}
.dl-qty-val { font-size: 13px; font-weight: 700; min-width: 16px; text-align: center; }
.dl-remove-item { color: var(--dl-red); font-size: 14px; cursor: pointer; background: none; border: none; }

/* ────────────────────────────────────────────────────────────
   ORDER SUMMARY
──────────────────────────────────────────────────────────── */
.dl-order-summary {
  background: white; margin: 10px 16px 0;
  border-radius: var(--dl-radius); padding: 14px;
  box-shadow: var(--dl-shadow-sm);
}
.dl-summary-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.dl-summary-row {
  display: flex; justify-content: space-between; margin-bottom: 6px;
}
.dl-summary-label { font-size: 13px; color: var(--dl-gray-600); }
.dl-summary-val { font-size: 13px; font-weight: 600; }
.dl-summary-divider {
  border: none; border-top: 1px solid var(--dl-gray-100); margin: 10px 0;
}
.dl-summary-total { font-size: 17px; font-weight: 800; color: var(--dl-orange); }

.dl-checkout-bar {
  position: fixed; bottom: 60px;
  left: 50%; transform: translateX(-50%);
  width: min(430px, 100%); background: white;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.08); z-index: 99;
}
.dl-checkout-btn {
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light));
  color: white; border: none; border-radius: 25px;
  padding: 12px 28px; font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: var(--dl-shadow-md);
  transition: opacity 0.2s;
}
.dl-checkout-btn:active { opacity: 0.85; }

/* ────────────────────────────────────────────────────────────
   PROFILE PAGE
──────────────────────────────────────────────────────────── */
.dl-profile-header {
  background: linear-gradient(160deg, var(--dl-orange) 0%, var(--dl-orange-light) 60%, var(--dl-yellow) 100%);
  padding: 24px 16px 36px; position: relative; overflow: hidden;
}
.dl-profile-header::before {
  content: ''; position: absolute; bottom: -30px; left: 0; right: 0;
  height: 50px; background: var(--dl-gray-100); border-radius: 50% 50% 0 0;
}
.dl-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--dl-yellow); display: flex;
  align-items: center; justify-content: center;
  font-size: 30px; border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  overflow: hidden;
}
.dl-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dl-profile-name { color: white; font-size: 18px; font-weight: 800; }
.dl-profile-meta { color: rgba(255,255,255,0.85); font-size: 12px; margin-top: 3px; }

/* ────────────────────────────────────────────────────────────
   MENU BLOCK
──────────────────────────────────────────────────────────── */
.dl-menu-block {
  background: white; margin: 10px 16px 0;
  border-radius: var(--dl-radius); overflow: hidden;
  box-shadow: var(--dl-shadow-sm);
}
.dl-menu-block-title {
  padding: 12px 14px; font-size: 13px;
  font-weight: 700; color: var(--dl-gray-600);
  border-bottom: 1px solid var(--dl-gray-100);
}
.dl-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-bottom: 1px solid var(--dl-gray-100);
  cursor: pointer; transition: background 0.15s; text-decoration: none;
  color: inherit;
}
.dl-menu-item:last-child { border-bottom: none; }
.dl-menu-item:active, .dl-menu-item:hover { background: var(--dl-gray-100); }
.dl-menu-icon { font-size: 18px; width: 28px; text-align: center; }
.dl-menu-label { font-size: 13px; font-weight: 500; }
.dl-menu-arrow { margin-left: auto; color: var(--dl-gray-400); font-size: 12px; }
.dl-menu-badge {
  margin-left: auto; background: var(--dl-orange); color: white;
  font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 8px;
}

/* ────────────────────────────────────────────────────────────
   SELLER PAGES
──────────────────────────────────────────────────────────── */
.dl-seller-topbar {
  background: linear-gradient(135deg, var(--dl-dark) 0%, var(--dl-dark2) 100%);
  padding: 14px 16px 12px; position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: space-between;
}
.dl-seller-badge {
  background: var(--dl-orange); color: white;
  font-size: 10px; font-weight: 700;
  border-radius: 6px; padding: 3px 9px;
}
.dl-seller-bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: min(430px, 100%);
  background: var(--dl-dark);
  display: flex; border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
}
.dl-seller-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 10px; cursor: pointer;
  color: rgba(255,255,255,0.4); transition: color 0.2s;
  text-decoration: none;
}
.dl-seller-nav-item.active,
.dl-seller-nav-item:hover { color: var(--dl-orange); }

/* Stat cards */
.dl-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 14px 16px 0;
}
.dl-stat-card {
  background: white; border-radius: var(--dl-radius);
  padding: 14px; box-shadow: var(--dl-shadow-sm);
}
.dl-stat-label { font-size: 11px; color: var(--dl-gray-400); font-weight: 500; }
.dl-stat-value { font-size: 22px; font-weight: 800; margin-top: 4px; }
.dl-stat-value.orange { color: var(--dl-orange); }
.dl-stat-change { font-size: 11px; color: var(--dl-green); margin-top: 2px; font-weight: 600; }

/* Order status badges */
.dl-status-new  { background: #FFF0E6; color: var(--dl-orange); border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.dl-status-ship { background: #E8F5E9; color: var(--dl-green);  border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 700; }
.dl-status-done { background: var(--dl-gray-100); color: var(--dl-gray-600); border-radius: 8px; padding: 3px 8px; font-size: 11px; font-weight: 700; }

/* ────────────────────────────────────────────────────────────
   AUTH PAGES
──────────────────────────────────────────────────────────── */
.dl-auth-bg {
  background: linear-gradient(160deg, var(--dl-orange) 0%, var(--dl-orange-light) 55%, var(--dl-yellow) 100%);
  padding: 52px 24px 44px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; overflow: hidden;
}
.dl-auth-bg::after {
  content: ''; position: absolute; bottom: -40px; left: 0; right: 0;
  height: 70px; background: var(--dl-gray-100); border-radius: 50% 50% 0 0;
}
.dl-auth-body { padding: 32px 24px 24px; }
.dl-auth-title {
  font-size: 17px; font-weight: 800; margin-bottom: 18px; text-align: center;
}
.dl-auth-form { display: flex; flex-direction: column; gap: 12px; }
.dl-auth-input-wrap {
  background: white; border-radius: 12px;
  display: flex; align-items: center;
  padding: 13px 16px; gap: 10px;
  box-shadow: var(--dl-shadow-sm); border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.dl-auth-input-wrap:focus-within { border-color: var(--dl-orange); }
.dl-auth-input-wrap input {
  border: none; outline: none; flex: 1; font-size: 14px; background: transparent;
}
.dl-auth-btn {
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light));
  color: white; border: none; border-radius: 14px; padding: 15px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: var(--dl-shadow-md); margin-top: 4px; transition: opacity 0.2s;
  width: 100%;
}
.dl-auth-btn:active { opacity: 0.85; }
.dl-auth-footer { text-align: center; margin-top: 16px; font-size: 12px; color: var(--dl-gray-400); }
.dl-auth-footer a { color: var(--dl-orange); font-weight: 600; }

/* ────────────────────────────────────────────────────────────
   WOOCOMMERCE OVERRIDES
──────────────────────────────────────────────────────────── */
.dl-body .woocommerce-notices-wrapper { padding: 0 16px; }
.dl-body .woocommerce-message,
.dl-body .woocommerce-error,
.dl-body .woocommerce-info {
  border-radius: var(--dl-radius); margin: 10px 0;
  font-size: 13px; padding: 10px 14px;
}
.dl-body .woocommerce-message { border-top-color: var(--dl-orange); }
.dl-body .woocommerce-error   { border-top-color: var(--dl-red); }

/* WooCommerce Form Fields */
.dl-body .woocommerce form .form-row label { font-size: 12px; font-weight: 600; color: var(--dl-gray-600); }
.dl-body .woocommerce form .form-row input.input-text,
.dl-body .woocommerce form .form-row select,
.dl-body .woocommerce form .form-row textarea {
  border: 1.5px solid var(--dl-gray-200);
  border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit;
  transition: border-color 0.2s; width: 100%;
}
.dl-body .woocommerce form .form-row input.input-text:focus,
.dl-body .woocommerce form .form-row select:focus {
  border-color: var(--dl-orange); outline: none;
}

/* WooCommerce Buttons */
.dl-body .woocommerce a.button,
.dl-body .woocommerce button.button,
.dl-body .woocommerce input.button,
.dl-body .woocommerce #place_order {
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light)) !important;
  color: white !important; border: none !important;
  border-radius: 12px !important; padding: 13px 20px !important;
  font-size: 14px !important; font-weight: 700 !important;
  cursor: pointer !important; box-shadow: var(--dl-shadow-md) !important;
  transition: opacity 0.2s !important; font-family: inherit !important;
}
.dl-body .woocommerce a.button:hover,
.dl-body .woocommerce button.button:hover { opacity: 0.9 !important; }

/* WooCommerce Cart Table */
.dl-body .woocommerce-cart-form { padding: 0 16px; }
.dl-body .woocommerce table.shop_table { border: none; border-radius: var(--dl-radius); overflow: hidden; font-size: 13px; }
.dl-body .woocommerce table.shop_table th { background: var(--dl-orange-pale); color: var(--dl-orange); font-weight: 700; }
.dl-body .woocommerce table.shop_table td { border-color: var(--dl-gray-100); }

/* WooCommerce Product Price */
.dl-body .woocommerce span.price,
.dl-body .woocommerce ins { color: var(--dl-orange); font-weight: 800; }
.dl-body .woocommerce del { color: var(--dl-gray-400); }

/* WooCommerce Star Rating */
.dl-body .woocommerce .star-rating span::before { color: var(--dl-yellow); }

/* ────────────────────────────────────────────────────────────
   TOAST NOTIFICATION
──────────────────────────────────────────────────────────── */
.dl-toast {
  position: fixed; bottom: 80px;
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,30,0.92); color: #fff;
  padding: 10px 20px; border-radius: 25px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  z-index: 9999; opacity: 0;
  transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
.dl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ────────────────────────────────────────────────────────────
   UTILITIES
──────────────────────────────────────────────────────────── */
.dl-spacer  { height: 10px; }
.dl-spacer-lg { height: 24px; }
.dl-text-orange { color: var(--dl-orange); }
.dl-text-red    { color: var(--dl-red); }
.dl-text-green  { color: var(--dl-green); }
.dl-fw-800      { font-weight: 800; }
.dl-text-sm     { font-size: 12px; }
.dl-text-xs     { font-size: 11px; }

@keyframes dl-fadeInCard {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dl-animate-in { animation: dl-fadeInCard 0.3s ease forwards; }

/* ────────────────────────────────────────────────────────────
   PAGE HEADER (used on all inner pages)
──────────────────────────────────────────────────────────── */
.dl-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light));
  padding: 16px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(255,107,0,.3);
}
.dl-page-title {
  color: white; font-size: 17px; font-weight: 800;
  flex: 1; margin: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.dl-back-icon {
  background: rgba(255,255,255,.2); border: none; border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; cursor: pointer;
  text-decoration: none; flex-shrink: 0;
}

/* ────────────────────────────────────────────────────────────
   FORM INPUTS (shared across checkout, account, address)
──────────────────────────────────────────────────────────── */
.dl-input-wrap {
  background: white; border-radius: 12px;
  display: flex; align-items: center;
  padding: 12px 14px; gap: 10px;
  box-shadow: var(--dl-shadow-sm);
  border: 1.5px solid transparent;
  transition: border-color .2s;
}
.dl-input-wrap:focus-within { border-color: var(--dl-orange); }
.dl-input-wrap input,
.dl-input-wrap textarea {
  border: none; outline: none; flex: 1;
  font-size: 14px; font-family: inherit;
  background: transparent; color: var(--dl-gray-800);
}
.dl-input-wrap input::placeholder,
.dl-input-wrap textarea::placeholder { color: var(--dl-gray-400); }

/* ────────────────────────────────────────────────────────────
   WOOCOMMERCE FORM FIELD OVERRIDES (checkout / account)
──────────────────────────────────────────────────────────── */
.dl-woo-field .input-text,
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="number"],
.woocommerce-checkout select,
.woocommerce-checkout textarea,
.woocommerce-EditAccountForm input[type="text"],
.woocommerce-EditAccountForm input[type="email"],
.woocommerce-EditAccountForm input[type="password"],
.woocommerce-address-fields input,
.woocommerce-address-fields select {
  width: 100% !important;
  border: 1.5px solid var(--dl-gray-200) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  font-family: 'Noto Sans Thai', sans-serif !important;
  color: var(--dl-gray-800) !important;
  background: white !important;
  box-shadow: var(--dl-shadow-sm) !important;
  transition: border-color .2s !important;
  appearance: none;
}
.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-EditAccountForm input:focus,
.woocommerce-address-fields input:focus,
.woocommerce-address-fields select:focus {
  outline: none !important;
  border-color: var(--dl-orange) !important;
  box-shadow: 0 0 0 3px rgba(255,107,0,.12) !important;
}
.woocommerce-checkout label,
.woocommerce-EditAccountForm label,
.woocommerce-address-fields label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--dl-gray-600) !important;
  margin-bottom: 5px !important;
  display: block;
}
.woocommerce-checkout .form-row,
.woocommerce-EditAccountForm p,
.woocommerce-address-fields .form-row { margin-bottom: 10px !important; }

/* WC payment radio buttons */
.wc_payment_method label {
  display: flex !important; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--dl-gray-200);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .2s;
}
.wc_payment_method input[type="radio"]:checked + label,
.wc_payment_method label:has(input:checked) {
  border-color: var(--dl-orange); background: var(--dl-orange-pale);
}
#place_order,
.woocommerce button[type="submit"],
.woocommerce input[type="submit"],
.woocommerce .button.alt,
.woocommerce .checkout-button {
  width: 100% !important;
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light)) !important;
  color: white !important; border: none !important;
  border-radius: 14px !important; padding: 15px !important;
  font-size: 15px !important; font-weight: 700 !important;
  cursor: pointer !important; font-family: inherit !important;
  box-shadow: 0 4px 16px rgba(255,107,0,.3) !important;
  transition: opacity .2s !important;
  margin-top: 8px !important;
}
#place_order:hover,
.woocommerce button[type="submit"]:hover { opacity: .9 !important; }

/* WC notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
  border-radius: 12px !important; padding: 12px 14px !important;
  font-size: 13px !important; margin: 0 16px 10px !important;
  border-left-width: 4px !important;
}
.woocommerce-message { background: #E8F5E9 !important; border-left-color: var(--dl-green) !important; color: #2E7D32 !important; }
.woocommerce-info    { background: #E3F2FD !important; border-left-color: #1565C0 !important; color: #1565C0 !important; }
.woocommerce-error   { background: #FFF0F0 !important; border-left-color: var(--dl-red) !important; color: var(--dl-red) !important; }

/* ────────────────────────────────────────────────────────────
   WC ACCOUNT NAVIGATION (inside my-account pages)
──────────────────────────────────────────────────────────── */
.woocommerce-MyAccount-navigation { display: none; } /* ใช้ custom nav แทน */
.woocommerce-MyAccount-content { padding: 0; }
.woocommerce-account .woocommerce { padding: 0; }

/* ────────────────────────────────────────────────────────────
   SELLER BOTTOM NAV
──────────────────────────────────────────────────────────── */
.dl-seller-bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(430px, 100%); background: #1a1a2e;
  display: flex; border-top: 1px solid rgba(255,255,255,.1);
  z-index: 1000; box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
.dl-seller-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 10px; color: rgba(255,255,255,.5);
  text-decoration: none; font-size: 10px; font-weight: 600;
}
.dl-seller-nav-item.active,
.dl-seller-nav-item:hover { color: var(--dl-yellow); }
.dl-seller-nav-item .dl-nav-icon { font-size: 20px; line-height: 1; }
.dl-seller-nav-item .dl-nav-label { font-size: 10px; margin-top: 3px; }

/* ────────────────────────────────────────────────────────────
   PRODUCT PAGE - FAV BUTTON
──────────────────────────────────────────────────────────── */
.dl-fav-btn {
  position: absolute; top: 8px; right: 8px;
  background: white; border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 14px;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}

/* ────────────────────────────────────────────────────────────
   ARCHIVE PRODUCT - PAGINATION
──────────────────────────────────────────────────────────── */
.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: white; color: var(--dl-gray-800);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--dl-shadow-sm); text-decoration: none;
}
.page-numbers.current { background: var(--dl-orange); color: white; }
.page-numbers:hover   { background: var(--dl-orange-pale); color: var(--dl-orange); }

/* ────────────────────────────────────────────────────────────
   LOADING SPINNER
──────────────────────────────────────────────────────────── */
.dl-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--dl-gray-200);
  border-top-color: var(--dl-orange);
  border-radius: 50%;
  animation: dl-spin .7s linear infinite;
  margin: 20px auto;
}
@keyframes dl-spin { to { transform: rotate(360deg); } }

/* ────────────────────────────────────────────────────────────
   SEARCH PAGE IMPROVEMENTS
──────────────────────────────────────────────────────────── */
#dl-search-input:focus { outline: none; }

/* ────────────────────────────────────────────────────────────
   WP ADMIN BAR OFFSET (logged in users)
──────────────────────────────────────────────────────────── */
.admin-bar .dl-topbar,
.admin-bar .dl-page-header { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .dl-topbar,
  .admin-bar .dl-page-header { top: 46px; }
}

/* ────────────────────────────────────────────────────────────
   PRODUCT CARD — complete CSS (covers both PHP & JS rendered)
──────────────────────────────────────────────────────────── */
.dl-stars {
  color: #FFD600;
  font-size: 10px;
  line-height: 1;
  margin-top: 3px;
}
.dl-product-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
}
.dl-product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
}
.dl-sold-count {
  font-size: 10px;
  color: var(--dl-gray-400);
}
.dl-add-to-cart-btn {
  background: var(--dl-orange);
  color: white;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.dl-add-to-cart-btn:active { transform: scale(0.9); }
.dl-sale-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #FF3B30;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 6px;
  z-index: 2;
}

/* category chip — button variant (AJAX filter, no navigation) */
button.dl-cat-chip {
  background: white;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
button.dl-cat-chip.active,
button.dl-cat-chip:hover {
  border-color: var(--dl-orange);
  background: var(--dl-orange-pale);
}

/* product grid loading state */
.dl-product-grid.dl-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* skeleton shimmer */
@keyframes dl-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.dl-skeleton {
  background: linear-gradient(90deg, #eeeeee 25%, #f5f5f5 50%, #eeeeee 75%);
  background-size: 200% 100%;
  animation: dl-shimmer 1.2s infinite;
  border-radius: 8px;
}

/* Banner dots */
.dl-banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 4px;
}
.dl-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--dl-gray-200);
  transition: all .2s;
}
.dl-dot.active {
  background: var(--dl-orange);
  width: 18px;
  border-radius: 3px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE DESKTOP LAYOUT
   Mobile  : < 768px  → แสดงผลแบบ app มือถือ
   Tablet  : 768-1023px → layout กึ่งกลาง
   Desktop : ≥ 1024px  → full layout พร้อม sidebar + topbar
   ════════════════════════════════════════════════════════════ */

/* ── Desktop Topbar (ซ่อนบน mobile) ─────────────────────── */
.dl-desktop-topbar { display: none; }
.dl-sidebar-desktop { display: none; }

@media (min-width: 768px) {

  /* ── Reset mobile-only constraints ─────────────────────── */
  body.dl-body {
    max-width: 100%;
    margin: 0;
    background: #f4f4f8;
  }

  /* ── Desktop Topbar ────────────────────────────────────── */
  .dl-desktop-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 500;
    background: linear-gradient(135deg, #FF6B00, #FF8C35);
    box-shadow: 0 2px 12px rgba(255,107,0,.25);
    height: 64px;
  }
  .dl-desktop-topbar-inner {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .dl-desktop-logo { display: flex; align-items: center; flex-shrink: 0; }
  .dl-desktop-logo svg { height: 28px; width: auto; }
  .dl-desktop-search {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.95);
    border-radius: 25px;
    padding: 0 16px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
  }
  .dl-desktop-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #333;
  }
  .dl-desktop-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
  }
  .dl-desktop-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background .15s;
    white-space: nowrap;
  }
  .dl-desktop-nav-link:hover,
  .dl-desktop-nav-link.active {
    background: rgba(255,255,255,.2);
    color: white;
  }
  .dl-desktop-cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    color: var(--dl-orange);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 25px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    white-space: nowrap;
  }
  .dl-desktop-cart-badge {
    background: #FF3B30;
    color: white;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
  }

  /* ── Hide mobile-only elements ─────────────────────────── */
  .dl-topbar       { display: none !important; }
  .dl-bottom-nav   { display: none !important; }
  .dl-seller-bottom-nav { display: none !important; }

  /* ── Page wrapper — desktop layout ────────────────────────
     Homepage: sidebar (240px) + main (flex:1)
     Inner pages: centered max-width, no sidebar
  ─────────────────────────────────────────────────────────── */
  .dl-page-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 0;
    background: transparent;
  }

  /* ── Main content wrapper ─────────────────────────────── */
  #dl-home-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto;
    gap: 0 24px;
    align-items: start;
  }

  /* Sidebar */
  .dl-sidebar-desktop {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    position: sticky;
    top: 88px;
    grid-row: 1 / 20;
    grid-column: 1;
  }
  .dl-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--dl-gray-400);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 8px 10px;
  }
  .dl-sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dl-gray-700, #444);
    text-decoration: none;
    transition: background .15s, color .15s;
  }
  .dl-sidebar-link:hover,
  .dl-sidebar-link.active {
    background: var(--dl-orange-pale);
    color: var(--dl-orange);
  }
  .dl-sidebar-link .dl-cat-emoji { font-size: 16px; }
  .dl-sidebar-divider {
    border: none;
    border-top: 1px solid var(--dl-gray-100);
    margin: 8px 0;
  }

  /* Sidebar = col 1, all other direct children = col 2 */
  #dl-home-page > * { grid-column: 2; }
  #dl-home-page > .dl-sidebar-desktop {
    grid-column: 1;
    grid-row: 1 / 100;  /* span all rows */
  }

  /* ── Banner — wider on desktop ─────────────────────────── */
  .dl-banner-wrap { padding: 0 0 0; }
  .dl-banner {
    border-radius: 18px;
    padding: 28px 32px;
    min-height: 140px;
  }
  .dl-banner-text h2 { font-size: 22px; }
  .dl-banner-emoji { font-size: 72px; }

  /* ── Category scroll → row ─────────────────────────────── */
  .dl-cat-scroll {
    padding: 14px 0;
    gap: 8px;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .dl-cat-chip {
    flex-shrink: 0;
  }

  /* ── Product grid — 3 columns ─────────────────────────── */
  .dl-product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    padding: 0 !important;
  }
  .dl-product-card {
    border-radius: 16px;
  }
  .dl-product-img {
    aspect-ratio: 4/3;
  }
  .dl-product-name { font-size: 13px; }
  .dl-price-now { font-size: 16px; }

  /* ── Section headers ───────────────────────────────────── */
  .dl-section { padding: 0; }
  .dl-section-title { font-size: 17px; }
  .dl-section-header { padding: 14px 0 6px; }

  /* ── Flash bar ─────────────────────────────────────────── */
  .dl-flash-bar { border-radius: 14px; }

  /* ── Inner pages (non-home) — centered container ──────── */
  body.dl-body:not(:has(#dl-home-page)) .dl-page-wrap,
  .dl-page-wrap:not(#dl-home-page) {
    max-width: 860px;
    margin: 24px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    background: white;
  }

  /* Page header on inner pages */
  .dl-page-header { border-radius: 0; }

  /* ── Shop / Archive page ───────────────────────────────── */
  .woocommerce-page .dl-page-wrap,
  .woocommerce-account .dl-page-wrap,
  .woocommerce-cart .dl-page-wrap,
  .woocommerce-checkout .dl-page-wrap {
    max-width: 960px;
    margin: 24px auto;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    background: white;
    overflow: hidden;
  }

  /* Archive product grid — 3 col on tablet, 4 col on desktop */
  .woocommerce-page #dl-product-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 16px;
    gap: 16px;
  }

  /* ── Cart / Checkout ───────────────────────────────────── */
  .woocommerce-checkout .woocommerce-checkout,
  .woocommerce-cart .woocommerce {
    padding: 24px;
  }

  /* ── Login / Register ─────────────────────────────────── */
  .woocommerce-account .dl-page-wrap {
    max-width: 480px;
  }

  /* ── Single product ───────────────────────────────────── */
  .single-product .dl-page-wrap {
    max-width: 900px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
  }

  /* ── Admin bar offset ─────────────────────────────────── */
  .admin-bar .dl-desktop-topbar { top: 32px; }
}

/* ── Large desktop: 4×4 product grid (4 cols × 4 rows) ─── */
@media (min-width: 1100px) {
  .dl-product-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(4, auto) !important;
    overflow: hidden !important;
  }
  .woocommerce-page #dl-product-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-template-rows: repeat(4, auto) !important;
    overflow: hidden !important;
  }
}

/* ── Tablet only (768–1023px): no sidebar, 2-col grid ───── */
@media (min-width: 768px) and (max-width: 1023px) {
  #dl-home-page {
    grid-template-columns: 1fr;
    max-width: 720px;
    padding: 16px;
  }
  #dl-home-page > * { grid-column: 1; }
  .dl-sidebar-desktop { display: none; }
  .dl-product-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .woocommerce-page #dl-product-grid { grid-template-columns: repeat(2, 1fr) !important; }
}


/* ── Cart page extra padding — checkout bar + bottom nav ─── */
/* checkout bar (bottom:60px, ~56px tall) + nav (60px) = ~130px */
body.woocommerce-cart .dl-page-wrap {
  padding-bottom: 140px !important;
}

/* ─── GUEST PRICE — ซ่อนราคา แสดงปุ่ม login ────────────── */
.dl-price-login-btn {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--dl-orange);
  background: var(--dl-orange-pale);
  border: 1px dashed var(--dl-orange);
  border-radius: 8px;
  padding: 4px 8px;
  text-decoration: none;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.4;
  max-width: 100%;
}
.dl-price-login-btn:hover {
  background: var(--dl-orange);
  color: white;
}
.dl-login-to-buy {
  font-size: 12px !important;
  padding: 6px 12px !important;
  background: var(--dl-orange) !important;
  color: white !important;
  border-radius: 10px !important;
  border: none !important;
}
.dl-guest-price-box {
  background: var(--dl-orange-pale);
  border: 1.5px dashed var(--dl-orange);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 16px 0;
  text-align: center;
}
.dl-guest-price-box p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--dl-gray-800);
}

/* ─── SINGLE PRODUCT — improved UI ───────────────────────── */
/* Price row */
.dl-pdp-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.dl-pdp-price-now {
  font-size: 30px;
  font-weight: 800;
  color: var(--dl-orange);
  line-height: 1;
}
.dl-pdp-price-old {
  font-size: 16px;
  color: var(--dl-gray-400);
  text-decoration: line-through;
}
.dl-pdp-disc-badge {
  background: #FF3B30;
  color: white;
  font-size: 12px;
  font-weight: 800;
  border-radius: 8px;
  padding: 3px 9px;
}
.dl-pdp-sold {
  font-size: 12px;
  color: var(--dl-gray-400);
  margin-top: 5px;
}

/* Guest login box */
.dl-pdp-login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--dl-orange-pale);
  border: 2px dashed var(--dl-orange);
  border-radius: 16px;
  padding: 20px 16px;
  margin-top: 14px;
  text-align: center;
}
.dl-pdp-login-lock { font-size: 32px; }
.dl-pdp-login-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dl-pdp-login-text strong {
  font-size: 14px;
  color: var(--dl-gray-800);
}
.dl-pdp-login-text span {
  font-size: 12px;
  color: var(--dl-gray-400);
}
.dl-pdp-login-btns {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.dl-pdp-btn-login {
  background: var(--dl-orange);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 12px;
  transition: opacity .2s;
}
.dl-pdp-btn-login:hover { opacity: .85; }
.dl-pdp-btn-register {
  background: white;
  color: var(--dl-orange);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 12px;
  border: 2px solid var(--dl-orange);
  transition: all .2s;
}
.dl-pdp-btn-register:hover {
  background: var(--dl-orange);
  color: white;
}

/* Add-to-cart section */
.dl-pdp-atc-wrap {
  background: white;
  padding: 16px;
  margin-bottom: 8px;
}
.dl-pdp-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dl-pdp-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dl-gray-100);
  border-radius: 25px;
  padding: 8px 16px;
  flex-shrink: 0;
}
.dl-pdp-qty-btn {
  background: none;
  border: none;
  font-size: 20px;
  font-weight: 700;
  color: var(--dl-orange);
  cursor: pointer;
  line-height: 1;
  width: 24px;
  text-align: center;
}
.dl-pdp-qty-num {
  font-size: 16px;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}
.dl-pdp-atc-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--dl-orange), var(--dl-orange-light));
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(255,107,0,.3);
  transition: opacity .2s;
}
.dl-pdp-atc-btn:active { opacity: .8; }
.dl-pdp-buynow-btn {
  width: 100%;
  margin-top: 10px;
  background: white;
  color: var(--dl-orange);
  border: 2px solid var(--dl-orange);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.dl-pdp-buynow-btn:hover {
  background: var(--dl-orange);
  color: white;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE DISPLAY FIXES
   ═══════════════════════════════════════════════════════════ */

/* ── FIX 1: Double Topbar on Inner Pages (Mobile Only) ──────
   หน้าที่มี .dl-page-header หรือมี custom topbar ฝังใน template
   (single-product, cart, checkout, orders, edit-account ฯลฯ)
   จะแสดง #dl-topbar จาก header.php ทับซ้อนกัน → ซ่อน #dl-topbar
─────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* ซ่อน main topbar บนทุกหน้าที่มี .dl-page-header อยู่ */
  body:has(.dl-page-header) #dl-topbar {
    display: none !important;
  }

  /* ซ่อน main topbar บนหน้า shop / archive / search
     (มี .dl-topbar ฝังอยู่ใน archive-product.php แล้ว) */
  body.woocommerce-shop    #dl-topbar,
  body.woocommerce-archive #dl-topbar,
  body.search-results      #dl-topbar {
    display: none !important;
  }

  /* เมื่อ #dl-topbar ถูกซ่อน → dl-page-header ติดขอบจอบนพอดี */
  body:has(.dl-page-header) .dl-page-header,
  body.woocommerce-shop    .dl-page-header,
  body.woocommerce-archive .dl-page-header {
    top: 0;
  }

  /* Admin bar offset สำหรับ dl-page-header เมื่อ topbar ถูกซ่อน */
  .admin-bar body:has(.dl-page-header) .dl-page-header {
    top: 46px;
  }
}

/* ── FIX 2: Archive/Shop page embedded topbar admin-bar offset ─ */
.admin-bar .woocommerce-shop    .dl-topbar:not(#dl-topbar),
.admin-bar .woocommerce-archive .dl-topbar:not(#dl-topbar) {
  top: 46px;
}
@media (min-width: 783px) {
  .admin-bar .woocommerce-shop    .dl-topbar:not(#dl-topbar),
  .admin-bar .woocommerce-archive .dl-topbar:not(#dl-topbar) {
    top: 32px;
  }
}

/* ── FIX 3: Checkout bar — ปรับ bottom ให้ถูกบน desktop ───────
   Mobile: bottom:60px (เหนือ bottom-nav)
   Desktop: bottom:0, static layout
─────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .dl-checkout-bar {
    position: static;
    width: 100%;
    transform: none;
    left: auto;
    bottom: auto;
    box-shadow: none;
    border-top: 1px solid var(--dl-gray-100);
    padding: 16px 24px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* ── FIX 4: Archive #dl-shop-grid — responsive columns ────────
   archive-product.php ใช้ id="dl-shop-grid" ไม่ใช่ #dl-product-grid
   desktop.css มีแค่ #dl-product-grid → shop page จึงแสดง 2 col ตลอด
─────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  #dl-shop-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    padding: 16px !important;
  }
  #dl-shop-grid.list-mode {
    grid-template-columns: 1fr !important;
  }
}
/* ── FIX 5: Thank-you page background ──────────────────────── */
.dl-thankyou-wrap {
  background: var(--dl-gray-100);
  min-height: 100vh;
}
@media (min-width: 768px) {
  .dl-thankyou-wrap {
    background: white; /* desktop shows white card */
  }
}

/* ── ท้ายไฟล์ style.css ── */
