/*
Theme Name: GrandMoya
Theme URI: https://grandmoya.com/
Author: Proton
Author URI: https://grandmoya.com/
Description: WordPress theme cloned from grandmoya.com — e-commerce theme for Leo & Prosee hair & body care products. Blue professional design with flash sale, product grid, catalogue sidebar, and slideshow hero.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: grandmoya
Tags: e-commerce, woocommerce, blog, two-columns, custom-menu, full-width-template
*/

/* =========================================
   0. CSS Custom Properties (Design Tokens)
   ========================================= */
:root {
  /* Brand palette — EXACT colors from grandmoya.com */
  --color-primary:        #0a6999;
  --color-primary-dark:   #002789;
  --color-accent:         #0f83be;
  --color-gold:           #edb42d;
  --color-sale:           #cf2030;
  --color-sale-orange:    #ff6c7a;
  --color-sale-hot:       #ff9800;
  --color-white:          #ffffff;
  --color-bg:             #f5f5f5;
  --color-text:           #333333;
  --color-text-light:     #666666;
  --color-border:         #e0e0e0;
  --color-divider:        #bdbdbd;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  15px;
  --space-lg:  25px;
  --space-xl:  35px;

  /* Borders */
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-pill: 25px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 2px 2px rgba(0,0,0,0.15);

  /* Typography */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================
   1. Reset & Base
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* =========================================
   2. Top Bar (white strip)
   ========================================= */
.top-bar {
  background: var(--color-white);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-light);
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar-left a,
.top-bar-right a {
  color: var(--color-text-light);
  margin-right: 15px;
  font-size: 13px;
}
.top-bar-right a { margin-right: 0; margin-left: 15px; }

/* =========================================
   3. Header (blue bar)
   ========================================= */
.site-header {
  background: var(--color-primary);
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 999;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Logo */
.site-logo img {
  height: 45px;
  filter: brightness(0) invert(1);
}

/* Navigation */
.main-navigation { flex: 1; }
.main-navigation ul {
  list-style: none;
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.main-navigation > ul > li {
  position: relative;
}
.main-navigation > ul > li > a {
  color: var(--color-white);
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 14px;
  display: inline-block;
  transition: all 0.2s ease;
}
.main-navigation > ul > li > a:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--color-white);
}

/* Sub-menu dropdown */
.main-navigation .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-white);
  min-width: 200px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: var(--space-sm) 0;
  display: none;
  z-index: 1000;
}
.main-navigation li:hover > .sub-menu {
  display: block;
}
.main-navigation .sub-menu li a {
  color: var(--color-text);
  padding: 8px 15px;
  display: block;
  font-size: 13px;
}
.main-navigation .sub-menu li a:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

/* Search bar */
.header-search {
  position: relative;
  margin-left: auto;
}
.header-search form {
  display: flex;
  align-items: center;
}
.header-search input[type="search"] {
  height: 35px;
  line-height: 35px;
  border-radius: var(--radius-pill);
  padding: 0 120px 0 15px;
  width: 468px;
  border: none;
  font-size: 14px;
  outline: none;
}
.header-search button[type="submit"] {
  position: absolute;
  right: 0;
  top: 0;
  height: 35px;
  line-height: 35px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-gold);
  color: #000;
  padding: 0 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.header-search button[type="submit"]:hover {
  background: #d4a028;
}

/* Cart/account icons */
.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.header-tools a {
  color: var(--color-white);
  font-size: 20px;
  position: relative;
}
.header-tools .cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--color-sale);
  color: var(--color-white);
  font-size: 10px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  text-align: center;
  font-weight: bold;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

/* =========================================
   4. Hero Section (Slideshow + Catalogue)
   ========================================= */
.hero-section {
  position: relative;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #e8f4f8;
}
.hero-section .container {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--space-md);
}

/* Catalogue sidebar */
.catalogue-sidebar {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.catalogue-sidebar .catalogue-header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.catalogue-sidebar .catalogue-list {
  list-style: none;
  padding: var(--space-sm) var(--space-md);
}
.catalogue-sidebar .catalogue-list li {
  padding: 10px 0 10px 35px;
  position: relative;
  border-top: 1px solid var(--color-divider);
}
.catalogue-sidebar .catalogue-list li:first-child {
  border-top: none;
}
.catalogue-sidebar .catalogue-list li .cat-icon {
  width: 22px;
  height: 22px;
  position: absolute;
  left: 0;
  top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.catalogue-sidebar .catalogue-list li .cat-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.catalogue-sidebar .catalogue-list li a {
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
}
.catalogue-sidebar .catalogue-list li a:hover {
  color: var(--color-primary);
}
.catalogue-sidebar .catalogue-list li::after {
  content: "›";
  position: absolute;
  top: 8px;
  right: 0;
  color: var(--color-primary);
  font-size: 18px;
  font-weight: bold;
}

/* Slideshow */
.slideshow-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.slideshow-container .slide {
  display: none;
  width: 100%;
}
.slideshow-container .slide.active {
  display: block;
}
.slideshow-container .slide img {
  width: 100%;
  height: 425px;
  object-fit: cover;
}
.slideshow-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-sm);
}
.slideshow-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  cursor: pointer;
  transition: background 0.3s ease;
}
.slideshow-dots .dot.active {
  background: var(--color-primary);
}

/* Sidebar promos */
.sidebar-promos {
  margin-top: var(--space-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.sidebar-promos .promo-banner {
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 205px;
}
.sidebar-promos .promo-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================
   5. Category Catalogue Tiles
   ========================================= */
.category-tiles {
  background: var(--color-white);
  padding: var(--space-lg) 0;
}
.category-tiles .container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-md);
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: center;
  background: var(--color-bg);
}
.category-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.category-tile .tile-icon {
  width: 65px;
  height: 65px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}
.category-tile .tile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-tile .tile-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}

/* =========================================
   6. Flash Sale Section
   ========================================= */
.flash-sale {
  background: var(--color-white);
  padding: var(--space-lg) 0;
}
.flash-sale-inner {
  background: var(--color-primary-dark);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}
.flash-sale-inner::before {
  content: '';
  position: absolute;
  width: 850px;
  height: 850px;
  top: -400px;
  right: -400px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.flash-sale-header {
  color: var(--color-white);
  margin-bottom: var(--space-lg);
}
.flash-sale-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

/* Countdown timer */
.countdown {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}
.countdown-unit {
  background: var(--color-sale);
  color: var(--color-white);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  min-width: 36px;
  text-align: center;
}
.countdown-sep {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 18px;
}

/* Flash sale product grid */
.flash-sale-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}
.flash-sale-product {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all 0.2s ease;
}
.flash-sale-product:hover {
  box-shadow: var(--shadow-md);
}
.flash-sale-product .product-image {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}
.flash-sale-product .product-image img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.flash-sale-product:hover .product-image img {
  transform: scale(1.05);
}
.flash-sale-product .product-name {
  font-size: 13px;
  line-height: 1.4;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: var(--space-sm);
}
.flash-sale-product .product-name a {
  color: var(--color-text);
}
.flash-sale-product .product-name a:hover {
  color: var(--color-primary);
}
.flash-sale-product .product-prices {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.flash-sale-product .sale-price {
  color: var(--color-sale);
  font-size: 16px;
  font-weight: 700;
}
.flash-sale-product .old-price {
  color: var(--color-text-light);
  font-size: 13px;
  text-decoration: line-through;
}
.flash-sale-product .discount-badge {
  background: var(--color-sale);
  color: var(--color-white);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}
.flash-sale-product .sold-bar {
  margin-top: var(--space-sm);
}
.sold-bar .sold-label {
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: 4px;
}
.sold-bar .progress {
  height: 16px;
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.sold-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-sale), var(--color-sale-orange));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-white);
  font-weight: 600;
  transition: width 0.5s ease;
}

/* =========================================
   7. Product Grid (Regular Products)
   ========================================= */
.products-section {
  padding: var(--space-xl) 0;
}
.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
}
.section-header p {
  color: var(--color-text-light);
  font-size: 14px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
}

/* Product Card */
.product-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.product-card .product-thumb {
  position: relative;
  overflow: hidden;
}
.product-card .product-thumb img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .product-thumb img {
  transform: scale(1.08);
}
.product-card .quick-add {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.product-card:hover .quick-add {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.product-card .quick-add:hover {
  background: var(--color-primary-dark);
}

.product-card .product-info {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}
.product-card .product-category {
  font-size: 11px;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.product-card .product-name {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.product-card .product-name a {
  color: var(--color-text);
}
.product-card .product-name a:hover {
  color: var(--color-primary);
}

.product-card .price-block {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.product-card .current-price {
  color: var(--color-sale);
  font-size: 15px;
  font-weight: 700;
}
.product-card .original-price {
  color: var(--color-text-light);
  font-size: 12px;
  text-decoration: line-through;
}
.product-card .discount-tag {
  background: var(--color-sale);
  color: var(--color-white);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

/* =========================================
   8. Footer
   ========================================= */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: var(--space-xl) 0 var(--space-md);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.footer-col h4 {
  color: var(--color-white);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  transition: color 0.2s ease;
}
.footer-col ul li a:hover {
  color: var(--color-white);
}
.footer-col p {
  font-size: 13px;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s ease;
}
.footer-social a:hover {
  background: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* =========================================
   9. WooCommerce Overrides
   ========================================= */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  list-style: none;
  padding: 0;
}
.woocommerce ul.products li.product {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}
.woocommerce ul.products li.product:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.woocommerce ul.products li.product .woocommerce-loop-product__link {
  display: block;
}
.woocommerce ul.products li.product .button {
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.woocommerce ul.products li.product .button:hover {
  background: var(--color-primary-dark);
}
.woocommerce ul.products li.product .price {
  color: var(--color-sale) !important;
  font-weight: 700 !important;
}
.woocommerce ul.products li.product .saled-by {
  color: var(--color-text-light) !important;
  text-decoration: line-through;
  font-size: 12px !important;
}

/* Cart page */
.woocommerce-cart table.cart {
  width: 100%;
  border-collapse: collapse;
}
.woocommerce-cart table.cart th {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 12px;
  font-size: 14px;
}
.woocommerce-cart table.cart td {
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* =========================================
   10. Responsive
   ========================================= */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .products-grid,
  .flash-sale-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .category-tiles .container {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .header-search input[type="search"] {
    width: 200px;
    padding-right: 90px;
  }

  .menu-toggle {
    display: block;
  }
  .main-navigation ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: var(--space-md);
    gap: 0;
  }
  .main-navigation.open ul {
    display: flex;
  }
  .main-navigation > ul > li > a {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
  }

  .products-grid,
  .flash-sale-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .category-tiles .container {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .sidebar-promos {
    grid-template-columns: 1fr;
  }
  .slideshow-container .slide img {
    height: 280px;
  }
  .catalogue-sidebar {
    display: none;
  }
}

@media (max-width: 480px) {
  .products-grid,
  .flash-sale-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(1, 1fr) !important;
  }
  .category-tiles .container {
    grid-template-columns: repeat(1, 1fr);
  }
}
