/*
Theme Name: SaikuShop
Theme URI: https://example.com/saikushop
Author: SaikuShop
Description: A custom WooCommerce theme converted from a high-fidelity mockup.
Version: 1.1
Text Domain: saikushop
*/

/* --- CORE VARIABLES --- */
:root {
  /* Palette */
  --primary: #e61f68;
  --primary-dark: #a60039;
  --teal-dark: #006b5f;
  --teal-light: #63baab;

  /* Light Theme Defaults */
  --bg-body: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --gradient-hero: linear-gradient(
    60deg,
    var(--primary-dark) 0%,
    var(--teal-dark) 100%
  );

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  --glass-blur: blur(16px);
  --radius-lg: 16px;
  --radius-md: 12px;
}

[data-theme="dark"] {
  /* Dark Theme Overrides */
  --bg-body: #0f1115;
  --bg-surface: #181b21;
  --bg-card: #1e2128;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border: #2d3748;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --gradient-hero: linear-gradient(60deg, #59001f 0%, #003630 100%);

  /* Dark Glass */
  --glass-bg: rgba(30, 33, 40, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden; /* Prevent blob overflow */
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}
ul {
  list-style: none;
}

article {
    min-height: 55vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- HEADER --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--glass-bg); /* Glass Header */
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  height: 100px;
  display: flex;
  align-items: center;
  transition: background-color 0.3s, border-color 0.3s;
  overflow: visible; /* Fix for dropdowns being clipped */
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-svg {
  height: 85px;
  width: auto;
  fill: var(--text-main);
  transition: fill 0.3s;
}
[data-theme="dark"] .logo-svg g[fill="#000000"] {
  fill: #ffffff;
}
[data-theme="dark"] .logo-svg g[fill="#ffffff"] {
  fill: #000000;
}

/* Navigation */
.main-nav {
  position: relative;
  z-index: 500; /* Ensure nav sits on top of other header elements */
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
}
.main-nav li {
  position: relative;
  list-style: none;
}
.main-nav a {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-main);
  display: block;
  padding: 10px 0;
}
.main-nav a:hover {
  color: var(--primary);
}

.main-nav ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  padding: 10px 0;
  z-index: 9999; /* Boosted to ensure it layers over everything */
  display: block;
}
.main-nav li.menu-item-has-children:hover > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-nav ul.sub-menu li {
  display: block;
}
.main-nav ul.sub-menu a {
  padding: 8px 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.main-nav ul.sub-menu a:hover {
  background: var(--bg-surface);
  color: var(--primary);
}
.main-nav li.menu-item-has-children > a::after {
  content: " ▾";
  font-size: 0.8em;
}

/* Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 5px;
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  color: var(--primary);
}

.btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
  border: 1px solid transparent;
}
.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
}

.cart-icon {
  position: relative;
  cursor: pointer;
  color: var(--text-main);
  margin-right: 5px;
}
.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--teal-dark);
  color: white;
  font-size: 10px;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- HERO --- */
.hero {
  position: relative;
  padding: 100px 0 150px 0;
  background: var(--gradient-hero);
  text-align: center;
  color: white;
  overflow: hidden;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: white;
  letter-spacing: -1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.hero p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 30px auto;
}
.hero-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}
.hero .btn-outline:hover {
  background: white;
  color: var(--primary);
  border-color: white;
}
.hero .btn-primary {
  background: white;
  color: var(--primary);
  border-color: white;
}
.hero .btn-primary:hover {
  background: #f0f0f0;
  border-color: #f0f0f0;
}

/* Waves */
.waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15vh;
  margin-bottom: -7px;
  min-height: 100px;
  max-height: 150px;
}
.parallax > use {
  animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}
.parallax > use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 7s;
  fill: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .parallax > use:nth-child(1) {
  fill: rgba(15, 17, 21, 0.7);
}
.parallax > use:nth-child(2) {
  animation-delay: -3s;
  animation-duration: 10s;
  fill: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .parallax > use:nth-child(2) {
  fill: rgba(15, 17, 21, 0.5);
}
.parallax > use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 13s;
  fill: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] .parallax > use:nth-child(3) {
  fill: rgba(15, 17, 21, 0.3);
}
.parallax > use:nth-child(4) {
  animation-delay: -5s;
  animation-duration: 20s;
  fill: var(--bg-body);
}
@keyframes move-forever {
  0% {
    transform: translate3d(-90px, 0, 0);
  }
  100% {
    transform: translate3d(85px, 0, 0);
  }
}

/* --- PRODUCTS GRID --- */
.section-title {
  text-align: center;
  margin: 60px 0 40px 0;
}
.section-title h2 {
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 10px;
}
.section-title span {
  color: var(--teal-light);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  padding-bottom: 80px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--teal-light);
}
.card-header {
  height: 350px;
  background: linear-gradient(
    135deg,
    var(--bg-surface) 0%,
    var(--bg-body) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.card-header img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  z-index: 1;
}
.card-icon {
  font-size: 2.5rem;
  color: var(--primary);
  z-index: 1;
}
.card-body {
  padding: 25px;
  flex-grow: 1;
}
.card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--text-main);
}
.card-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.card-footer {
  padding: 20px 25px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}
.price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--teal-dark);
}
.price del {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-right: 5px;
  opacity: 0.7;
}
.price span {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* --- WOOCOMMERCE PRODUCT PAGE (SLEEK GLASS) --- */

/* Wrapper layout */
.woocommerce div.product {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-top: 20px;
  margin-bottom: 40px;
}

/* Gallery - rounded and clean */
.woocommerce div.product div.images {
  flex: 1 1 45%;
  margin-bottom: 0;
}
.woocommerce div.product div.images img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
}

/* Summary - The text area */
.woocommerce div.product div.summary {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.woocommerce div.product .product_title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-main);
}

.woocommerce div.product .price {
  font-size: 1.5rem;
  color: var(--teal-dark);
  margin-bottom: 25px;
}

.woocommerce div.product .woocommerce-product-details__short-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 30px;
}

/* Add to Cart Area */
.woocommerce div.product form.cart {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(var(--primary), 0.05); /* Slight tint background */
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.woocommerce div.product form.cart .quantity input {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  font-weight: 600;
  width: 60px;
  text-align: center;
}

.woocommerce
  div.product
  div.images
  .woocommerce-product-gallery__image--placeholder {
  border: none;
}

.woocommerce div.product form.cart .button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 50px; /* Pill shape */
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-grow: 1;
  text-align: center;
}
.woocommerce div.product form.cart .button:hover {
  background: var(--primary-dark);
  box-shadow: 0 5px 15px rgba(230, 31, 104, 0.3);
  transform: translateY(-2px);
}

/* Tabs - Sleek/Minimal */
.woocommerce div.product .woocommerce-tabs {
  flex-basis: 100%; /* Force tabs to bottom */
  margin-top: 20px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0;
  margin: 0 0 20px;
  list-style: none;
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: transparent;
  border: none;
  margin: 0;
  padding: 0;
}

/* Remove default WC tab pseudo-elements */
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
  content: none !important;
  display: none !important;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  padding: 10px 0;
  display: block;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.woocommerce div.product .woocommerce-tabs .panel {
  background: transparent;
  color: var(--text-muted);
}

/* Related Products */
.woocommerce .related.products {
  margin-top: 60px;
  width: 100%; /* Fix width issues where it might be constrained */
  float: none;
  clear: both;
}
.woocommerce .related.products h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 30px;
}

/* Force removal of WooCommerce float clearing hacks that break Grid */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  content: none !important;
  display: none !important;
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  margin: 0;
  padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: none;
}
.woocommerce ul.products li.product {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.3s;
  list-style: none;
  margin: 0; /* Reset WP margins */
  width: auto; /* Let Grid handle width */
  float: none; /* Disable WP floats */
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

header.woocommerce-products-header {
    background: none;
    backdrop-filter: none;
    z-index: -1;
    border-bottom: none;
}

.woocommerce ul.products li.product img {
  margin-bottom: 15px;
  border-radius: 8px;
  width: 100%;
  height: auto;
  display: block;
}
.woocommerce ul.products li.product h2 {
  font-size: 1rem;
  margin-bottom: 5px;
}
.woocommerce ul.products li.product .price {
  font-size: 0.95rem;
  display: block;
  margin-bottom: 15px;
  color: var(--teal-dark);
  font-weight: 700;
}
.woocommerce ul.products li.product .button {
  width: 100%;
  display: block;
  text-align: center;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
}
.woocommerce ul.products li.product .button:hover {
  background: var(--primary);
  color: white;
}

/* --- WOOCOMMERCE CHECKOUT & CART (CLASSIC) --- */

/* Glass Wrapper for Cart & Checkout Forms */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-top: 20px;
}

/* Layout Columns */
.col2-set {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
}
.col2-set .col-1, 
.col2-set .col-2 {
    flex: 1;
    min-width: 300px;
    max-width: 100%;
}

/* Form Fields */
.woocommerce form .form-row {
    padding: 0;
    margin-bottom: 20px;
    margin-right: 10px;
}
.woocommerce form .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230, 31, 104, 0.1);
    background: #fff;
}

/* Select2 Overrides (if used by Woo) */
.select2-container .select2-selection--single {
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 48px;
    padding-left: 15px;
    color: var(--text-main);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
}

/* Your Order Table */
.woocommerce-checkout-review-order-table,
.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    background: var(--bg-card);
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.woocommerce table.shop_table th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text-main);
}
.woocommerce table.shop_table tr:last-child td,
.woocommerce table.shop_table tr:last-child th {
    border-bottom: none;
}
.woocommerce table.shop_table .product-name {
    color: var(--text-main);
    font-weight: 500;
}
.woocommerce table.shop_table .product-total,
.woocommerce table.shop_table .order-total td {
    font-weight: 700;
    color: var(--teal-dark);
}

/* Payment Section */
#payment {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid var(--border);
}
#payment ul.payment_methods {
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 1px solid var(--border);
}
#payment ul.payment_methods li {
    list-style: none;
    margin-bottom: 15px;
}
#payment ul.payment_methods li input {
    margin-right: 10px;
    accent-color: var(--primary);
}
#payment ul.payment_methods li label {
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}
#payment div.payment_box {
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 10px 0 20px 0;
    position: relative;
}
#payment #place_order {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}
#payment #place_order:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 31, 104, 0.3);
}

/* Notices (Coupon, Login) */
.woocommerce-info, .woocommerce-message, .woocommerce-error {
    background: var(--bg-surface);
    border-top: 3px solid var(--primary);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 0 0 4px 4px;
    box-shadow: var(--shadow);
    color: var(--text-main);
    list-style: none;
}
.woocommerce-error {
    border-top-color: #dc2626; /* Red */
}
.woocommerce-message {
    border-top-color: var(--teal-light);
}
.woocommerce-info::before, .woocommerce-message::before {
    display: none; /* Remove default icon to keep it clean */
}
.woocommerce-info a {
    color: var(--primary);
    font-weight: 600;
}
.woocommerce-info a:hover {
    text-decoration: underline;
}

/* Coupon Form inside Toggle */
form.checkout_coupon, form.login {
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.3);
}

/* --- FOOTER --- */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 60px 0 20px 0;
  color: var(--text-muted);
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: var(--text-main);
  margin-bottom: 20px;
}
.footer-col ul li {
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.footer-col ul li a:hover {
  color: var(--primary);
}
.copyright {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 0.85rem;
}
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .header-inner {
    padding: 0 10px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .woocommerce div.product {
    padding: 20px;
  }
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary {
    flex: 1 1 100%;
  }
  .woocommerce ul.products[class*=columns-] li.product, .woocommerce-page ul.products[class*=columns-] li.product {
      width: 100%;
  }
}