/*
Theme Name: Benty Clone
Theme URI: https://example.com/benty-clone
Author: Custom
Author URI: https://example.com
Description: Theme WooCommerce phong cách Benty - quần áo trẻ em, hỗ trợ chọn size/màu nhanh, COD/VNPay/Momo (demo), GHN/GHTK (demo).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: benty-clone
Tags: woocommerce, e-commerce, baby-clothing
*/

/* ==========================================
   RESET & VARIABLES
========================================== */
:root {
  --color-primary: #1e3a5f;
  --color-primary-dark: #14263d;
  --color-secondary: #f8a5c2;
  --color-accent: #ffd966;
  --color-bg: #ffffff;
  --color-bg-soft: #f7f9fc;
  --color-text: #2c3e50;
  --color-text-light: #7a8b9d;
  --color-border: #e5ebf2;
  --color-sale: #e74c3c;
  --color-success: #27ae60;
  --font-main: 'Be Vietnam Pro', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 58, 95, 0.1);
  --shadow-lg: 0 8px 32px rgba(30, 58, 95, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 15px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-secondary); }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
  border: 2px solid var(--color-primary);
}
.btn:hover { background: #fff; color: var(--color-primary); }
.btn-outline { background: transparent; color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ==========================================
   HEADER
========================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.header-top {
  background: var(--color-primary);
  color: #fff;
  padding: 8px 0;
  font-size: 13px;
  text-align: center;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 30px;
}

.site-logo img { max-height: 50px; }
.site-logo .logo-text {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 1px;
}

.main-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.main-nav a {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary);
  position: relative;
  padding: 8px 0;
}
.main-nav a:hover::after,
.main-nav .current-menu-item > a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--color-secondary);
}

.header-icons {
  display: flex;
  gap: 20px;
  align-items: center;
}
.header-icon {
  position: relative;
  color: var(--color-primary);
  font-size: 22px;
}
.cart-count {
  position: absolute;
  top: -8px; right: -10px;
  background: var(--color-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-toggle { display: none; font-size: 24px; color: var(--color-primary); }

/* ==========================================
   HERO BANNER
========================================== */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, #fff5f7 0%, #e8f0fe 100%);
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(248,165,194,0.3), transparent);
  border-radius: 50%;
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(30,58,95,0.1), transparent);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 2; }
.hero-content h1 {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.2;
}
.hero-content p {
  font-size: 18px;
  color: var(--color-text-light);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================
   STORY SECTION
========================================== */
.story-section {
  padding: 80px 0;
  text-align: center;
}
.story-section h2 {
  font-size: 36px;
  color: var(--color-primary);
  margin-bottom: 24px;
  font-weight: 800;
}
.story-section p {
  font-size: 17px;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto 30px;
}
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 50px;
}
.story-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  aspect-ratio: 16/10;
  background: linear-gradient(45deg, #f8a5c2, #1e3a5f);
}
.story-card img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================
   SECTION HEADER
========================================== */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}
.section-header h2 {
  font-size: 36px;
  color: var(--color-primary);
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.section-header h2::after {
  content: '';
  display: block;
  width: 60px; height: 4px;
  background: var(--color-secondary);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ==========================================
   PRODUCT TABS
========================================== */
.product-section { padding: 80px 0; background: var(--color-bg-soft); }
.product-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.product-tab {
  padding: 10px 22px;
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  transition: var(--transition);
}
.product-tab.active,
.product-tab:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==========================================
   PRODUCT GRID & CARD
========================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  border: 1px solid var(--color-border);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--color-bg-soft);
}
.product-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-image img { transform: scale(1.05); }

.product-badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 12px;
  background: var(--color-secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  z-index: 2;
}
.product-badge.sale { background: var(--color-sale); }
.product-badge.new { background: var(--color-success); }

.quick-add {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(30, 58, 95, 0.95);
  color: #fff;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: translateY(100%);
  transition: var(--transition);
  cursor: pointer;
}
.product-card:hover .quick-add { transform: translateY(0); }

.product-info { padding: 16px; }
.product-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.4;
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-info h3 a { color: inherit; }
.product-info h3 a:hover { color: var(--color-primary); }

.product-price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.price-current {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
}
.price-old {
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: line-through;
}
.price-discount {
  background: var(--color-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Variation swatches (size + color) */
.variation-swatches { padding: 0 16px 16px; }
.swatches-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.swatches-label {
  font-size: 11px;
  color: var(--color-text-light);
  text-transform: uppercase;
  font-weight: 600;
  width: 100%;
  margin-bottom: 4px;
}
.swatch-size {
  min-width: 36px;
  padding: 4px 8px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #fff;
  transition: var(--transition);
  cursor: pointer;
}
.swatch-size:hover, .swatch-size.selected {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}
.swatch-color {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--color-border);
  cursor: pointer;
  transition: var(--transition);
}
.swatch-color:hover, .swatch-color.selected {
  box-shadow: 0 0 0 2px var(--color-primary);
  transform: scale(1.1);
}

/* ==========================================
   PROMO SECTION
========================================== */
.promo-section { padding: 60px 0; }
.promo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}
.promo-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 30px;
  color: #fff;
}
.promo-card.tall { aspect-ratio: 8/10; grid-row: span 2; }
.promo-card h3 { font-size: 24px; font-weight: 800; }

/* ==========================================
   STATS SECTION
========================================== */
.stats-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  text-align: center;
}
.stats-section .section-intro {
  max-width: 800px;
  margin: 0 auto 50px;
}
.stats-section h2 { font-size: 32px; margin-bottom: 16px; font-weight: 800; }
.stats-section .section-intro p { font-size: 16px; opacity: 0.9; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}
.stat-item {
  background: rgba(255,255,255,0.1);
  padding: 30px 20px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}
.stat-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 8px;
}
.stat-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* ==========================================
   NEWSLETTER
========================================== */
.newsletter {
  padding: 80px 0;
  background: var(--color-bg-soft);
  text-align: center;
}
.newsletter h2 {
  font-size: 32px;
  color: var(--color-primary);
  margin-bottom: 16px;
  font-weight: 800;
}
.newsletter p { color: var(--color-text-light); margin-bottom: 30px; }
.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  gap: 8px;
}
.newsletter-form input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.newsletter-form input:focus { border-color: var(--color-primary); }

/* ==========================================
   FOOTER
========================================== */
.site-footer {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 60px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  color: var(--color-accent);
}
.footer-col p, .footer-col a {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-bottom: 10px;
  display: block;
}
.footer-col a:hover { color: var(--color-accent); }
.social-icons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.social-icons a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.social-icons a:hover { background: var(--color-secondary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}

/* Floating contact buttons */
.floating-contact {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.floating-contact a {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-md);
}
.floating-contact a.zalo { background: #0068ff; }
.floating-contact a.phone { background: #27ae60; }
.floating-contact a.messenger { background: #0084ff; }

/* ==========================================
   WOOCOMMERCE PAGES
========================================== */
.page-banner {
  background: linear-gradient(135deg, #f8a5c2, #1e3a5f);
  padding: 60px 0;
  color: #fff;
  text-align: center;
}
.page-banner h1 { font-size: 36px; font-weight: 800; }
.breadcrumb { margin-top: 10px; font-size: 14px; opacity: 0.9; }
.breadcrumb a { color: #fff; text-decoration: underline; }

.shop-wrapper { padding: 60px 0; }
.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}
.shop-sidebar { background: #fff; padding: 24px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); height: fit-content; }
.shop-sidebar h4 { color: var(--color-primary); margin-bottom: 16px; font-size: 16px; }
.shop-sidebar ul { list-style: none; }
.shop-sidebar li { padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.shop-sidebar li:last-child { border: none; }
.shop-sidebar a { font-size: 14px; color: var(--color-text); }
.shop-sidebar a:hover { color: var(--color-primary); }

/* Cart page */
.woocommerce-cart .container { padding: 60px 20px; }
.cart-table {
  width: 100%;
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
}
.cart-table th {
  background: var(--color-primary);
  color: #fff;
  padding: 16px;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
}
.cart-table td {
  padding: 20px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.cart-product { display: flex; gap: 16px; align-items: center; }
.cart-product img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
.cart-product h4 { font-size: 14px; }
.qty-control { display: inline-flex; align-items: center; border: 1.5px solid var(--color-border); border-radius: 50px; overflow: hidden; }
.qty-control button { width: 32px; height: 36px; background: var(--color-bg-soft); }
.qty-control button:hover { background: var(--color-primary); color: #fff; }
.qty-control input { width: 40px; height: 36px; text-align: center; border: none; outline: none; font-weight: 600; }

.cart-totals {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-top: 30px;
  max-width: 400px;
  margin-left: auto;
}
.cart-totals h3 { color: var(--color-primary); margin-bottom: 20px; }
.cart-totals .row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.cart-totals .row:last-of-type { border: none; font-size: 18px; font-weight: 700; color: var(--color-primary); }

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  padding: 40px 0;
}
.checkout-form, .checkout-summary {
  background: #fff;
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.checkout-form h3 { color: var(--color-primary); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--color-border); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--color-text); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--color-primary);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.payment-methods, .shipping-methods { margin-top: 20px; }
.method-option {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}
.method-option:hover, .method-option.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-soft);
}
.method-option input { width: 18px; height: 18px; }
.method-option .method-info h5 { font-size: 14px; margin-bottom: 4px; }
.method-option .method-info span { font-size: 12px; color: var(--color-text-light); }

.checkout-summary h3 { color: var(--color-primary); margin-bottom: 20px; }
.summary-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.summary-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.summary-item .info { flex: 1; }
.summary-item h5 { font-size: 13px; margin-bottom: 4px; }
.summary-item .meta { font-size: 12px; color: var(--color-text-light); }
.summary-item .price { font-weight: 700; color: var(--color-primary); }

/* ==========================================
   SINGLE PRODUCT
========================================== */
.single-product-wrap { padding: 60px 0; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.product-gallery { position: relative; }
.gallery-main { aspect-ratio: 1/1; border-radius: var(--radius-md); overflow: hidden; background: var(--color-bg-soft); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumb { aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; cursor: pointer; opacity: 0.7; border: 2px solid transparent; }
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: var(--color-primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-summary h1 { font-size: 28px; color: var(--color-primary); margin-bottom: 16px; }
.product-summary .price { font-size: 28px; color: var(--color-primary); font-weight: 800; margin-bottom: 20px; }
.product-summary .description { color: var(--color-text-light); margin-bottom: 24px; line-height: 1.7; }
.product-options { margin-bottom: 24px; }
.product-options h4 { font-size: 14px; text-transform: uppercase; margin-bottom: 12px; }
.add-to-cart-row { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }

/* ==========================================
   RESPONSIVE
========================================== */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 0; left: -100%;
    width: 280px; height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 60px 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .main-nav.open { left: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .promo-grid { grid-template-columns: 1fr; }
  .promo-card.tall { grid-row: auto; aspect-ratio: 16/10; }
  .hero-content h1 { font-size: 32px; }
  .story-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-number { font-size: 32px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .product-tabs { gap: 6px; }
  .product-tab { padding: 8px 14px; font-size: 12px; }
  .newsletter-form { flex-direction: column; }
}
