/*
Theme Name: PknCoco Modern
Theme URI: https://pkncoco.com
Description: ธีมลูก (Child Theme) ของ Astra สำหรับ pkncoco.com โทนขาว-เขียวพาสเทล สไตล์ Gen Z Modern Minimal พร้อม Micro-interactions และความยืดหยุ่นสูง
Author: pkncoco
Template: astra
Version: 2.1.0
Text Domain: pkncoco-modern
*/

/* ==========================================================================
   0. FONTS IMPORT
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;600;700&family=Prompt:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS — ขาว-เขียวพาสเทล มินิมอล Gen Z
   ========================================================================== */
:root {
  --white: #FFFFFF;
  --bg: #F7FAF6;
  --paper: #FFFFFF;
  
  /* Pastel Greens */
  --mint-50: #F0F9F3;
  --mint-100: #E3F4E8;
  --mint-200: #C4EACF;
  --sage-400: #78D19F;
  --sage-600: #3EB075;
  --green-700: #1B633F;
  --green-900: #103823;
  
  /* Accent Colors */
  --peach: #FFB098;
  --peach-dark: #FF7E54;
  --peach-light: #FFF0EB;
  
  /* Neutral / Ink */
  --ink: #19241E;
  --ink-muted: #5C6E63;
  --line: rgba(27, 99, 63, 0.08);
  --line-focus: rgba(62, 176, 117, 0.4);
  
  /* Modern Glass & Shadows */
  --glass-bg: rgba(247, 250, 246, 0.82);
  --shadow-sm: 0 4px 12px rgba(16, 56, 35, 0.04);
  --shadow-md: 0 12px 28px rgba(16, 56, 35, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 56, 35, 0.12);
  --shadow-glow: 0 8px 24px rgba(62, 176, 117, 0.25);
  
  /* Border Radius */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  
  /* Fonts */
  --font-display: 'Prompt', 'Fredoka', 'Noto Sans Thai', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans Thai', sans-serif;
  
  /* Smooth Easing */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   2. GLOBAL / RESET & TYPOGRAPHY
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg) !important;
  color: var(--ink) !important;
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6,
.entry-title, .page-title,
.ast-woocommerce-container .products .product .woocommerce-loop-product__title {
  font-family: var(--font-display) !important;
  color: var(--green-900) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
}

a {
  color: var(--green-700);
  transition: color 0.2s var(--ease-smooth);
  text-decoration: none;
}

a:hover {
  color: var(--peach-dark);
}

::selection {
  background: var(--mint-200);
  color: var(--green-900);
}

/* Custom Soft Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--mint-200);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--sage-400);
}

/* ==========================================================================
   3. BUTTONS (Gen Z Pill Style + Micro-Interactions)
   ========================================================================== */
.ast-button, button, input[type="button"], input[type="submit"],
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.wp-block-button__link {
  background: linear-gradient(135deg, var(--sage-600) 0%, var(--green-700) 100%) !important;
  border: none !important;
  color: #fff !important;
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  padding: 12px 28px !important;
  box-shadow: var(--shadow-glow);
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s var(--ease-smooth), background 0.25s ease !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ast-button:hover, button:hover, input[type="button"]:hover, input[type="submit"]:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(27, 99, 63, 0.35) !important;
  background: linear-gradient(135deg, var(--sage-400) 0%, var(--green-700) 100%) !important;
}

.ast-button:active, button:active, .woocommerce a.button:active {
  transform: translateY(-1px) scale(0.99);
}

/* Secondary Button Alt */
.woocommerce a.button.alt, .woocommerce button.button.alt {
  background: var(--peach-dark) !important;
  box-shadow: 0 8px 20px rgba(255, 126, 84, 0.3) !important;
}
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover {
  background: #f06a3f !important;
  box-shadow: 0 12px 24px rgba(255, 126, 84, 0.4) !important;
}

/* ==========================================================================
   4. HEADER / NAVIGATION (Glassmorphism & Clean Floating feel)
   ========================================================================== */
.site-header, #masthead, .main-header-bar {
  background: var(--glass-bg) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 999;
}

.site-title a, .ast-site-identity a, .site-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color: var(--green-900) !important;
  font-size: 26px !important;
  letter-spacing: -0.03em;
}

.main-header-menu .menu-item a, .main-navigation ul li a {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  color: var(--green-900) !important;
  opacity: 0.85;
  padding: 8px 16px !important;
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease-smooth);
}

.main-header-menu .menu-item a:hover, .main-navigation ul li a:hover,
.main-header-menu .current-menu-item > a {
  opacity: 1;
  color: var(--peach-dark) !important;
  background: var(--peach-light);
}

/* Header Cart Count Badge */
.ast-site-header-cart .cart-container .count, .ast-cart-menu-wrap .count {
  background: var(--peach-dark) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: var(--radius-pill) !important;
  box-shadow: 0 4px 10px rgba(255, 126, 84, 0.4);
  transition: transform 0.3s var(--ease-bounce);
}

.ast-site-header-cart .cart-container .count.pkncoco-pulse {
  animation: pkncoco-pulse 0.6s var(--ease-bounce);
}

@keyframes pkncoco-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

/* ==========================================================================
   5. SHOP / PRODUCT GRID (Modern Soft Cards + Smooth Lift)
   ========================================================================== */
.woocommerce ul.products, .woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
  gap: 24px !important;
  margin-top: 20px !important;
}

.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 16px !important;
  margin: 0 !important;
  width: 100% !important;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-bounce), box-shadow 0.35s var(--ease-smooth), border-color 0.3s ease !important;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Fallback visibility to ensure items are never stuck invisible */
.woocommerce ul.products li.product {
  opacity: 1;
  transform: translateY(0);
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--mint-200) !important;
}

/* Image Container */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce ul.products li.product img {
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  transition: transform 0.5s var(--ease-smooth) !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.woocommerce ul.products li.product:hover img {
  transform: scale(1.06);
}

/* Product Titles & Prices */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 16px !important;
  margin: 12px 0 6px 0 !important;
  line-height: 1.35 !important;
}

.woocommerce ul.products li.product .price {
  color: var(--sage-600) !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  margin-bottom: 12px !important;
}

.woocommerce ul.products li.product .price del {
  opacity: 0.45;
  color: var(--ink-muted) !important;
  font-weight: 400 !important;
  margin-right: 4px;
}

.woocommerce ul.products li.product .price ins {
  text-decoration: none;
  color: var(--peach-dark) !important;
  font-weight: 800;
}

/* OnSale Badge */
.woocommerce ul.products li.product .onsale,
.woocommerce span.onsale {
  background: linear-gradient(135deg, #FF9F80, var(--peach-dark)) !important;
  color: #fff !important;
  border-radius: var(--radius-pill) !important;
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  padding: 4px 12px !important;
  min-height: auto !important;
  line-height: 1.4 !important;
  top: 14px !important;
  left: 14px !important;
  right: auto !important;
  box-shadow: 0 4px 12px rgba(255, 126, 84, 0.35);
}

.woocommerce ul.products li.product .button {
  margin-top: auto !important;
  width: 100% !important;
  text-align: center;
  font-size: 14px !important;
  padding: 10px 16px !important;
}

/* ==========================================================================
   6. SINGLE PRODUCT PAGE
   ========================================================================== */
.woocommerce div.product {
  background: var(--paper);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.woocommerce div.product .product_title {
  font-size: 34px !important;
  line-height: 1.2 !important;
  margin-bottom: 12px !important;
}

.woocommerce div.product p.price, .woocommerce div.product span.price {
  color: var(--sage-600) !important;
  font-weight: 800 !important;
  font-size: 28px !important;
}

.woocommerce div.product .woocommerce-product-gallery {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  border: 1px solid var(--line);
}

.woocommerce div.product .woocommerce-product-gallery img {
  border-radius: var(--radius-lg) !important;
}

.woocommerce div.product form.cart .quantity input.qty {
  border-radius: var(--radius-pill) !important;
  border: 1.5px solid var(--mint-200) !important;
  background: var(--mint-50) !important;
  color: var(--green-900) !important;
  font-weight: 700 !important;
  padding: 8px 12px !important;
  font-family: var(--font-display) !important;
}

/* ==========================================================================
   7. CART / CHECKOUT / INPUT FORM STYLES
   ========================================================================== */
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row select, 
.woocommerce form .form-row textarea {
  border-radius: var(--radius-md) !important;
  border: 1.5px solid var(--line) !important;
  background: var(--paper) !important;
  padding: 12px 16px !important;
  font-family: var(--font-body) !important;
  transition: all 0.2s var(--ease-smooth);
}

.woocommerce form .form-row input.input-text:focus, 
.woocommerce form .form-row select:focus, 
.woocommerce form .form-row textarea:focus {
  border-color: var(--sage-600) !important;
  outline: none !important;
  box-shadow: 0 0 0 4px var(--line-focus) !important;
  background: #fff !important;
}

.widget_shopping_cart, .site-header-cart .widget_shopping_cart,
.woocommerce-cart table.shop_table, .woocommerce-checkout table.shop_table {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--line) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.woocommerce table.shop_table thead th {
  background: var(--mint-100) !important;
  color: var(--green-900) !important;
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  border: none !important;
  padding: 16px !important;
}

.woocommerce-checkout #payment, .woocommerce-checkout-review-order {
  background: var(--paper) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--line) !important;
  padding: 28px !important;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.site-footer, #footer {
  background: var(--mint-50) !important;
  border-top: 1px solid var(--line);
  color: var(--ink-muted) !important;
  margin-top: 60px;
  padding-top: 40px;
  padding-bottom: 20px;
}

.site-footer a {
  color: var(--green-900);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--peach-dark);
}

.footer-widget-area .widget-title, .site-footer .widget-title {
  font-family: var(--font-display) !important;
  color: var(--green-900) !important;
  font-size: 18px !important;
  margin-bottom: 16px !important;
}

/* ==========================================================================
   9. INTERACTIVE COMPONENTS (Toast, ToTop)
   ========================================================================== */
#pkncoco-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 140%);
  z-index: 9999;
  background: var(--green-900);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.4s var(--ease-bounce);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-display);
  border: 1px solid var(--sage-400);
}

#pkncoco-toast.show {
  transform: translate(-50%, 0);
}

#pkncoco-totop {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 9998;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--green-900);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  transition: all 0.3s var(--ease-bounce);
  font-size: 20px;
}

#pkncoco-totop:hover {
  background: var(--sage-600);
  color: #fff;
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-glow);
}

#pkncoco-totop.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   10. RESPONSIVE DESIGN
   ========================================================================== */
.ast-container {
  max-width: 1200px !important;
}

@media (max-width: 768px) {
  .woocommerce ul.products, .woocommerce-page ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }
  
  .woocommerce div.product {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .woocommerce ul.products li.product {
    padding: 12px !important;
    border-radius: var(--radius-md) !important;
  }

  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px !important;
  }
  
  .site-title a, .ast-site-identity a, .site-title {
    font-size: 22px !important;
  }

  #pkncoco-totop {
    right: 16px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
}