/*
Theme Name: Shopee Blue
Theme URI: https://yoursite.com
Author: Your Name
Author URI: https://yoursite.com
Description: A Shopee-inspired WordPress theme with blue color scheme. Fully responsive with mobile-first design.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shopee-blue
Tags: e-commerce, responsive, custom-colors, custom-menu, featured-images, full-width-template, two-columns, left-sidebar, right-sidebar

This theme, like WordPress, is licensed under the GPL.
*/

/* =============================================
   CSS CUSTOM PROPERTIES
   ============================================= */
:root {
  /* Primary Blue Palette */
  --primary:        #1A50A0;
  --primary-dark:   #0D3A7A;
  --primary-light:  #2E6BC8;
  --primary-xlight: #EAF1FB;

  /* Accent */
  --accent:         #FF6633;
  --accent-hover:   #E8552A;

  /* Neutrals */
  --white:          #FFFFFF;
  --gray-50:        #F8F9FC;
  --gray-100:       #F0F2F7;
  --gray-200:       #E2E6EF;
  --gray-400:       #A0AABF;
  --gray-600:       #6B7A99;
  --gray-800:       #2D3A52;
  --black:          #1A2236;

  /* Status */
  --success:        #00B050;
  --warning:        #FFAA00;
  --danger:         #EF3340;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm:  0 1px 3px rgba(26,80,160,0.08);
  --shadow-md:  0 4px 12px rgba(26,80,160,0.12);
  --shadow-lg:  0 8px 24px rgba(26,80,160,0.18);
  --shadow-xl:  0 16px 40px rgba(26,80,160,0.22);

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-base: 0.25s ease;
  --trans-slow: 0.4s ease;

  /* Layout */
  --container-max: 1200px;
  --header-h:      130px;   /* topbar 34 + main 60 + cat-nav 36 */
  --header-h-mob:  56px;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans Thai', 'Sarabun', 'Prompt', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--black);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--black);
}

.text-primary  { color: var(--primary); }
.text-accent   { color: var(--accent); }
.text-muted    { color: var(--gray-600); }
.text-sm       { font-size: 12px; }
.text-xs       { font-size: 11px; }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page-wrapper { padding-top: var(--header-h); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--trans-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-xlight); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--primary); }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.badge-primary  { background: var(--primary); color: var(--white); }
.badge-accent   { background: var(--accent); color: var(--white); }
.badge-success  { background: var(--success); color: var(--white); }
.badge-warning  { background: var(--warning); color: var(--white); }
.badge-danger   { background: var(--danger); color: var(--white); }

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--trans-base), transform var(--trans-base);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* =============================================
   PRODUCT CARD
   ============================================= */
.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-base);
  cursor: pointer;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.product-card__image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--gray-100);
}
.product-card__image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--trans-slow);
}
.product-card:hover .product-card__image img { transform: scale(1.06); }

.product-card__badges {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__wishlist {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 32px; height: 32px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: opacity var(--trans-fast);
  font-size: 16px;
}
.product-card:hover .product-card__wishlist { opacity: 1; }

.product-card__body { padding: var(--space-sm) var(--space-md) var(--space-md); }

.product-card__title {
  font-size: 13px;
  font-weight: 400;
  color: var(--black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 36px;
  margin-bottom: var(--space-xs);
}

.product-card__price {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
}
.product-card__price-current {
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}
.product-card__price-original {
  color: var(--gray-400);
  font-size: 12px;
  text-decoration: line-through;
}
.product-card__price-discount {
  background: var(--accent);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-600);
}
.product-card__rating { display: flex; align-items: center; gap: 2px; }
.product-card__stars { color: #FFB800; }

.product-card__location {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* =============================================
   PRODUCT GRID
   ============================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-sm);
}

@media (max-width: 1199px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 991px)  { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 479px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary);
}
.section-header__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.section-header__title::before {
  content: '';
  width: 4px; height: 20px;
  background: var(--primary);
  border-radius: 2px;
}
.section-header__link {
  color: var(--primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--trans-fast);
}
.section-header__link:hover { color: var(--primary-dark); }

/* =============================================
   STARS RATING
   ============================================= */
.stars {
  display: inline-flex;
  gap: 1px;
}
.stars .star { color: #FFB800; font-size: 14px; }
.stars .star.empty { color: var(--gray-200); }

/* =============================================
   PRICE
   ============================================= */
.price-tag { color: var(--accent); font-weight: 700; }
.price-original { color: var(--gray-400); text-decoration: line-through; font-size: 0.85em; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: var(--space-md); }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: var(--space-xs);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,80,160,0.12);
}

/* =============================================
   DIVIDERS
   ============================================= */
.divider {
  height: 1px;
  background: var(--gray-200);
  margin: var(--space-md) 0;
}

/* =============================================
   SPINNER / LOADING
   ============================================= */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   TOAST NOTIFICATION
   ============================================= */
.toast-container {
  position: fixed;
  top: 80px;
  right: var(--space-md);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  min-width: 240px;
  border-left: 4px solid var(--primary);
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
}
.page-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--trans-fast);
  color: var(--gray-800);
  background: var(--white);
}
.page-btn:hover, .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: var(--space-md);
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-400); }

/* =============================================
   STICKY ELEMENTS
   ============================================= */
.sticky-top { position: sticky; top: calc(var(--header-h) + var(--space-md)); }

/* =============================================
   MODAL OVERLAY
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--trans-base);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--trans-base);
}
.modal-overlay.active .modal { transform: scale(1); }

/* =============================================
   SKELETON LOADING
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* =============================================
   SCROLL TO TOP
   ============================================= */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: var(--space-md);
  width: 44px; height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--trans-base);
  z-index: 100;
  font-size: 18px;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* =============================================
   MOBILE BOTTOM NAV
   ============================================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 200;
  padding: var(--space-xs) 0;
}
@media (max-width: 767px) { .mobile-bottom-nav { display: flex; } }
.mobile-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-xs);
  font-size: 10px;
  color: var(--gray-600);
  cursor: pointer;
  transition: color var(--trans-fast);
}
.mobile-bottom-nav__item.active,
.mobile-bottom-nav__item:hover { color: var(--primary); }
.mobile-bottom-nav__item .icon { font-size: 22px; line-height: 1; }
.mobile-bottom-nav__item .badge-dot {
  position: absolute;
  top: 2px; right: 16px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none; }
.d-block  { display: block; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm   { gap: var(--space-sm); }
.gap-md   { gap: var(--space-md); }
.mt-md    { margin-top: var(--space-md); }
.mb-md    { margin-bottom: var(--space-md); }
.p-md     { padding: var(--space-md); }
.rounded  { border-radius: var(--radius-md); }
.overflow-hidden { overflow: hidden; }
.w-full   { width: 100%; }
.text-center { text-align: center; }
.relative { position: relative; }

@media (max-width: 767px) {
  .d-mobile-none  { display: none !important; }
  .d-mobile-block { display: block !important; }
}
@media (min-width: 768px) {
  .d-desktop-none { display: none !important; }
}
