/*
Theme Name: Reactive
Theme URI: https://rugpjute.lt
Description: Modern server-rendered WordPress theme with Alpine.js reactivity for WooCommerce
Version: 0.3.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
Author: Reactive Team
Author URI: https://rugpjute.lt
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: reactive
Tags: e-commerce, woocommerce, accessibility-ready

Reactive WordPress Theme - Built with Alpine.js
*/

/* ==========================================================================
   CSS Custom Properties (Essential Only)
   ========================================================================== */

:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-text: #1f2937;
  --color-bg: #ffffff;
  --color-border: #e5e7eb;

  /* Spacing */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Typography */
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-size-base: 1rem;

  /* Layout */
  --container-max: 1200px;
}

/* ==========================================================================
   Minimal Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

/* ==========================================================================
   Alpine.js Utility
   ========================================================================== */

[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   Container
   ========================================================================== */

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

/* ==========================================================================
   Accessibility
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

/* Site Branding */
.site-branding {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--color-primary);
}

.site-description {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Navigation */
.main-navigation {
  flex: 1;
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  display: block;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
  background-color: #f3f4f6;
  color: var(--color-primary);
}

/* Header Cart */
.header-cart {
  position: relative;
}

.cart-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text);
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
  position: relative;
  /* Button reset styles */
  border: none;
  background: transparent;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}

.cart-link:hover {
  background-color: #f3f4f6;
}

.cart-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 4px;
}

.cart-total {
  font-weight: 600;
  color: var(--color-text);
}

/* ==========================================================================
   Buttons (Modern, Simple Design)
   ========================================================================== */

.button,
button[type="submit"],
input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  background-color: #1f2937;
  border: 2px solid #1f2937;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background-color: #111827;
  border-color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.button:active,
button[type="submit"]:active,
input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: none;
}

.button:disabled,
button[type="submit"]:disabled,
input[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Alternative button style */
.button.alt {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

.button.alt:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
}

/* ==========================================================================
   Add to Cart Buttons
   ========================================================================== */

.add_to_cart_button {
  position: relative;
  transition: all 0.2s ease;
  min-width: 180px; /* Prevent width jump during state changes */
}

.add_to_cart_button.loading {
  opacity: 0.6;
  cursor: wait;
  pointer-events: none;
}

.add_to_cart_button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

.add_to_cart_button.added {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: white !important;
}

/* Single product page button */
.single_add_to_cart_button {
  min-width: 200px; /* Wider for "Select options" text */
}

/* ==========================================================================
   Product Quantity Input
   ========================================================================== */

.quantity {
  display: inline-block;
  margin-right: var(--space-sm);
}

.quantity input.qty {
  width: 60px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-family: inherit;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 500px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  pointer-events: all;
  border-left: 4px solid;
}

.toast p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text);
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.toast-close:hover {
  background-color: #f3f4f6;
  color: var(--color-text);
}

.toast-success {
  border-left-color: #10b981;
}

.toast-error {
  border-left-color: #ef4444;
}

.toast-warning {
  border-left-color: #f59e0b;
}

.toast-info {
  border-left-color: #3b82f6;
}

/* Toast animations */
.toast-enter {
  animation: slideInRight 0.3s ease-out;
}

.toast-leave {
  animation: slideOutRight 0.2s ease-in;
}

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

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

/* Cart icon shake animation when item added */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.header-cart.shake {
  animation: shake 0.5s ease-in-out;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */

/* Mobile Menu Toggle - Hamburger Icon */
.mobile-menu-toggle {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  margin: 0;
  position: relative;
  z-index: 110;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 28px;
  height: 24px;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger animation when active */
.hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Header Actions Container */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 280px;
  max-width: 85vw;
  background: var(--color-bg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 105;
  overflow-y: auto;
  padding: calc(var(--space-xl) * 2) var(--space-lg) var(--space-xl);
}

.mobile-navigation {
  width: 100%;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-menu li {
  margin: 0;
}

.mobile-nav-menu a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.125rem;
  padding: var(--space-md);
  display: block;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu .current-menu-item a {
  background-color: #f3f4f6;
  color: var(--color-primary);
}

/* Mobile Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 104;
  backdrop-filter: blur(2px);
}

/* Alpine.js Transitions */
.drawer-enter {
  transition: transform 0.3s ease-out;
}

.drawer-enter-start {
  transform: translateX(100%);
}

.drawer-enter-end {
  transform: translateX(0);
}

.drawer-leave {
  transition: transform 0.25s ease-in;
}

.drawer-leave-start {
  transform: translateX(0);
}

.drawer-leave-end {
  transform: translateX(100%);
}

.overlay-enter {
  transition: opacity 0.3s ease-out;
}

.overlay-enter-start {
  opacity: 0;
}

.overlay-enter-end {
  opacity: 1;
}

.overlay-leave {
  transition: opacity 0.25s ease-in;
}

.overlay-leave-start {
  opacity: 1;
}

.overlay-leave-end {
  opacity: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile: Show hamburger, hide desktop nav */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .desktop-nav {
    display: none;
  }
}

/* Desktop: Hide mobile elements */
@media (min-width: 769px) {
  .mobile-menu-toggle,
  .mobile-nav-drawer,
  .mobile-nav-overlay {
    display: none !important;
  }
}

/* ==========================================================================
   Shop Archive - Exemplary Clean Structure
   ========================================================================== */

.shop-archive {
  padding: var(--space-xl) 0;
}

.shop-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.shop-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.woocommerce-result-count {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.woocommerce-ordering {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.woocommerce-ordering select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25rem;
  appearance: none;
  cursor: pointer;
}

.woocommerce-ordering select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Product Grid - Clean, Responsive Layout
   ========================================================================== */

.products {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   Product Card - Exemplary Single-Link Structure
   ========================================================================== */

.product-card {
  display: block;
  height: 100%;
}

.product-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
  background: white;
}

.product-link:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.product-link:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.33;
  overflow: hidden;
  background-color: #f9fafb;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-link:hover .product-image img {
  transform: scale(1.05);
}

.product-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: var(--space-md) var(--space-md) var(--space-sm);
  color: var(--color-text);
}

.product-rating {
  margin: 0 var(--space-md);
  font-size: 0.875rem;
}

.product-price {
  margin: auto var(--space-md) var(--space-md);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.product-price .price {
  display: block;
}

.product-price del {
  opacity: 0.5;
  font-size: 0.875rem;
  margin-right: var(--space-sm);
}

.product-price ins {
  text-decoration: none;
  color: #dc2626;
}

/* ==========================================================================
   Sidebar - Clean Semantic Structure
   ========================================================================== */

.site-sidebar {
  padding: var(--space-xl);
  background: #f9fafb;
  border-radius: 0.5rem;
}

@media (max-width: 768px) {
  .site-sidebar {
    margin-top: var(--space-xl);
  }
}

/* ==========================================================================
   Pagination - Accessible Navigation
   ========================================================================== */

.woocommerce-pagination {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
}

.woocommerce-pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-sm);
}

.woocommerce-pagination li {
  margin: 0;
}

.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.woocommerce-pagination .page-numbers:hover {
  background-color: #f9fafb;
  border-color: var(--color-primary);
}

.woocommerce-pagination .page-numbers.current {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 600;
}

.woocommerce-pagination .page-numbers.next,
.woocommerce-pagination .page-numbers.prev {
  font-weight: 600;
}

/* ==========================================================================
   Single Product Page - Exemplary Clean Layout
   ========================================================================== */

.single-product {
  padding: var(--space-xl) 0;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl) 2rem;
  }
}

@media (min-width: 1024px) {
  .product-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

/* ==========================================================================
   Product Gallery - Clean Image Display
   ========================================================================== */

.product-gallery {
  position: relative;
}

.woocommerce-product-gallery {
  opacity: 1 !important; /* Override default WC opacity */
}

.woocommerce-product-gallery__wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.woocommerce-product-gallery__image {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #f9fafb;
}

.woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.woocommerce-product-gallery__image:hover img {
  transform: scale(1.02);
}

/* ==========================================================================
   Product Summary - Information Section
   ========================================================================== */

.product-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.product_title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}

.product-summary .price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.product-summary .price del {
  opacity: 0.5;
  font-size: 1.25rem;
  margin-right: var(--space-sm);
}

.product-summary .price ins {
  text-decoration: none;
  color: #dc2626;
}

/* Variations table */
.variations {
  width: 100%;
  border-spacing: 0;
  margin: var(--space-md) 0;
}

.variations tr {
  border-bottom: 1px solid var(--color-border);
}

.variations th {
  text-align: left;
  padding: var(--space-sm) 0;
  font-weight: 500;
  width: 30%;
}

.variations td {
  padding: var(--space-sm) 0;
}

.variations select {
  width: 100%;
  max-width: 200px;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 1rem;
}

.variations .reset_variations {
  margin-left: var(--space-sm);
  font-size: 0.875rem;
  text-decoration: none;
  color: #6b7280;
}

.variations .reset_variations:hover {
  color: var(--color-text);
}

/* Product meta */
.product_meta {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: #6b7280;
}

.product_meta > span {
  display: block;
  margin-bottom: var(--space-sm);
}

.product_meta a {
  color: var(--color-text);
  text-decoration: none;
}

.product_meta a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   Product Details - Tabs Section
   ========================================================================== */

.product-details {
  margin-top: var(--space-xl);
}

.woocommerce-tabs {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xl);
}

.woocommerce-tabs .tabs {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg);
  display: flex;
  gap: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.woocommerce-tabs .tabs li {
  margin: 0;
}

.woocommerce-tabs .tabs a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.woocommerce-tabs .tabs a:hover {
  color: var(--color-text);
}

.woocommerce-tabs .tabs li.active a {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

.woocommerce-Tabs-panel {
  padding: var(--space-lg) 0;
}

.woocommerce-Tabs-panel h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.woocommerce-Tabs-panel h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: var(--space-lg) 0 var(--space-sm);
}

.woocommerce-Tabs-panel p {
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.woocommerce-Tabs-panel ul {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   Cart Page - Exemplary Reactive AJAX Structure
   ========================================================================== */

.cart-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* Empty Cart State */
.cart-empty {
  text-align: center;
  padding: var(--space-xxl) var(--space-lg);
  background: #f9fafb;
  border-radius: 0.5rem;
  margin-bottom: var(--space-lg);
}

.empty-cart-message p {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: var(--space-lg);
}

.return-to-shop {
  margin-top: var(--space-lg);
}

.return-to-shop .button {
  display: inline-block;
  padding: var(--space-sm) var(--space-xl);
  background: var(--color-primary);
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.return-to-shop .button:hover {
  background: #2563eb;
}

/* Cart Header */
.cart-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--color-border);
}

.cart-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.cart-count {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
}

.cart-count strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Cart Layout - Two Column Grid */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .cart-layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* Cart Items Section */
.cart-items {
  width: 100%;
}

/* Cart Table */
.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.shop_table.cart thead {
  background: #f9fafb;
  border-bottom: 2px solid var(--color-border);
}

.shop_table.cart thead th {
  padding: var(--space-md);
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #6b7280;
}

.shop_table.cart thead th.product-thumbnail {
  width: 100px;
}

.shop_table.cart thead th.product-price,
.shop_table.cart thead th.product-quantity {
  width: 120px;
  text-align: center;
}

.shop_table.cart thead th.product-subtotal {
  width: 140px;
  text-align: right;
}

.shop_table.cart thead th.product-remove {
  width: 60px;
  text-align: center;
}

.shop_table.cart tbody tr.cart-item {
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

.shop_table.cart tbody tr.cart-item:hover {
  background-color: #f9fafb;
}

.shop_table.cart tbody td {
  padding: var(--space-lg) var(--space-md);
  vertical-align: middle;
}

/* Product Thumbnail */
.shop_table.cart .product-thumbnail {
  padding: var(--space-md);
}

.shop_table.cart .product-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.375rem;
  border: 1px solid var(--color-border);
}

.shop_table.cart .product-thumbnail a {
  display: block;
  transition: opacity 0.2s ease;
}

.shop_table.cart .product-thumbnail a:hover {
  opacity: 0.8;
}

/* Product Name */
.shop_table.cart .product-name {
  font-weight: 500;
}

.shop_table.cart .product-name a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.shop_table.cart .product-name a:hover {
  color: var(--color-primary);
}

.shop_table.cart .product-name .wc-item-meta {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: #6b7280;
}

/* Product Price */
.shop_table.cart .product-price {
  text-align: center;
  font-weight: 600;
  color: var(--color-text);
}

/* Product Quantity - Modern Controls */
.shop_table.cart .product-quantity {
  text-align: center;
}

.shop_table.cart .quantity-controls {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  overflow: hidden;
  background: white;
}

.shop_table.cart .qty-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: #f9fafb;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop_table.cart .qty-btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: white;
}

.shop_table.cart .qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.shop_table.cart .qty-btn.qty-decrease {
  border-right: 1px solid var(--color-border);
}

.shop_table.cart .qty-btn.qty-increase {
  border-left: 1px solid var(--color-border);
}

.shop_table.cart .qty {
  width: 60px;
  height: 36px;
  padding: 0;
  text-align: center;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  -moz-appearance: textfield;
}

.shop_table.cart .qty::-webkit-outer-spin-button,
.shop_table.cart .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop_table.cart .qty:focus {
  outline: none;
}

.shop_table.cart .qty:disabled {
  background-color: #f9fafb;
  cursor: not-allowed;
  opacity: 0.6;
}

.updating-spinner {
  display: inline-block;
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-left: var(--space-sm);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Product Subtotal */
.shop_table.cart .product-subtotal {
  text-align: right;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
}

/* Remove Button */
.shop_table.cart .product-remove {
  text-align: center;
}

.shop_table.cart .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.shop_table.cart .remove:hover {
  background: #fee2e2;
  color: #991b1b;
}

.shop_table.cart .remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Cart Totals Sidebar */
.cart-totals {
  background: white;
  padding: var(--space-xl);
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: var(--space-lg);
  align-self: start;
}

.cart-totals h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.cart-totals .cart-subtotal,
.cart-totals .order-total {
  display: flex;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-totals .cart-subtotal th,
.cart-totals .order-total th {
  font-weight: 500;
  color: #6b7280;
  text-align: left;
}

.cart-totals .order-total {
  border-bottom: none;
  padding-top: var(--space-lg);
  margin-top: var(--space-md);
  border-top: 2px solid var(--color-border);
}

.cart-totals .order-total th {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.cart-totals .order-total td {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: right;
}

/* Proceed to Checkout */
.wc-proceed-to-checkout {
  margin-top: var(--space-lg);
}

.wc-proceed-to-checkout .checkout-button {
  display: block;
  width: 100%;
  padding: var(--space-md);
  background: var(--color-primary);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.wc-proceed-to-checkout .checkout-button:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Coupon Section */
.cart-coupon-section {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
}

.coupon-form {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.coupon-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.coupon-input:disabled {
  background-color: #e5e7eb;
  cursor: not-allowed;
}

.coupon-button {
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.coupon-button:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.coupon-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.applied-coupons {
  margin-top: var(--space-md);
}

.applied-coupons h3 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #6b7280;
  margin-bottom: var(--space-sm);
}

.applied-coupons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.applied-coupon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.875rem;
}

.coupon-code {
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
}

.remove-coupon {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-coupon:hover:not(:disabled) {
  background: #dc2626;
  color: white;
}

.remove-coupon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Responsive Cart Table */
@media (max-width: 768px) {
  .shop_table.cart {
    display: block;
  }

  .shop_table.cart thead {
    display: none;
  }

  .shop_table.cart tbody,
  .shop_table.cart tr,
  .shop_table.cart td {
    display: block;
    width: 100%;
  }

  .shop_table.cart tbody tr.cart-item {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
  }

  .shop_table.cart tbody tr.cart-item:hover {
    background: white;
  }

  .shop_table.cart tbody td {
    padding: var(--space-sm) 0;
    text-align: left !important;
  }

  .shop_table.cart .product-thumbnail {
    text-align: center;
    padding: 0 0 var(--space-md);
  }

  .shop_table.cart .product-thumbnail img {
    width: 120px;
    height: 120px;
  }

  .shop_table.cart .product-name {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
  }

  .shop_table.cart .product-price,
  .shop_table.cart .product-quantity,
  .shop_table.cart .product-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
  }

  .shop_table.cart .product-price::before,
  .shop_table.cart .product-quantity::before,
  .shop_table.cart .product-subtotal::before {
    content: attr(data-title);
    font-weight: 600;
    color: #6b7280;
  }

  .shop_table.cart .product-remove {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
  }

  .shop_table.cart .remove {
    width: 100%;
    padding: var(--space-sm);
    background: #fee2e2;
    color: #991b1b;
    font-size: 1rem;
    font-weight: 500;
  }

  .cart-totals {
    position: static;
    margin-top: var(--space-xl);
  }

  .coupon-form {
    flex-direction: column;
  }

  .coupon-button {
    width: 100%;
  }
}

.woocommerce-Tabs-panel li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

/* ========================================
   Mini Cart Drawer
   ======================================== */

/* Overlay */
.mini-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Drawer */
.mini-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: white;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
}

/* Header */
.mini-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.mini-cart-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.mini-cart-header .cart-count {
  display: inline-block;
  margin-left: var(--space-xs);
  padding: 0.125rem 0.5rem;
  background: var(--color-primary);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.mini-cart-header .close-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: #f3f4f6;
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-cart-header .close-button:hover {
  background: #e5e7eb;
}

/* Loading State */
.mini-cart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-md);
}

.mini-cart-loading .spinner {
  font-size: 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Empty Cart */
.mini-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-lg);
  text-align: center;
  color: #6b7280;
}

/* Cart Items */
.mini-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.mini-cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.mini-cart-item:last-child {
  border-bottom: none;
}

/* Item Image */
.mini-cart-item .item-image {
  width: 64px;
  height: 64px;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #f9fafb;
}

.mini-cart-item .item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Item Details */
.mini-cart-item .item-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.mini-cart-item .item-name {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.mini-cart-item .item-quantity {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  overflow: hidden;
  width: fit-content;
}

.mini-cart-item .qty-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: #f9fafb;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-cart-item .qty-btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: white;
}

.mini-cart-item .qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mini-cart-item .qty-display {
  width: 32px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.mini-cart-item .item-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Item Remove Button */
.mini-cart-item .item-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.mini-cart-item .item-remove:hover:not(:disabled) {
  background: #dc2626;
  color: white;
}

.mini-cart-item .item-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */
.mini-cart-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg);
}

.mini-cart-footer .cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

.mini-cart-footer .cart-subtotal strong {
  font-size: 1.125rem;
  color: var(--color-primary);
}

.mini-cart-footer .cart-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mini-cart-footer .button {
  width: 100%;
  text-align: center;
}

.mini-cart-footer .button-secondary {
  background: #f3f4f6;
  color: var(--color-text);
}

.mini-cart-footer .button-secondary:hover {
  background: #e5e7eb;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .mini-cart-drawer {
    max-width: 100%;
  }
}

/* More styles will be added as we build components */
