/*
Theme Name: Modern eCommerce Theme
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A modern, performance-optimized WordPress theme built for WooCommerce. Features a mobile-first design, clean layouts, and full eCommerce functionality. Ready for Razorpay, shipping plugins, and WhatsApp automation integration.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: modern-ecommerce
Tags: e-commerce, woocommerce, responsive, mobile-first, clean, modern, seo-ready

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

/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */

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

:root {
  /* Color Palette */
  --color-primary: #2d3748;
  --color-secondary: #4a5568;
  --color-accent: #3182ce;
  --color-accent-hover: #2c5282;
  --color-text: #1a202c;
  --color-text-light: #718096;
  --color-background: #ffffff;
  --color-background-alt: #f7fafc;
  --color-border: #e2e8f0;
  --color-success: #48bb78;
  --color-warning: #ed8936;
  --color-error: #f56565;

  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Helvetica Neue', Arial, sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Container */
  --container-max-width: 1200px;
  --container-padding: 1rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

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

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--spacing-2xl) 0;
}

.section-alt {
  background-color: var(--color-background-alt);
}

/* ============================================
   BUTTONS
   ============================================ */

.button,
button[type="submit"],
.wp-block-button__link,
.woocommerce .button,
.woocommerce button.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  background-color: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.button:hover,
button[type="submit"]:hover,
.wp-block-button__link:hover,
.woocommerce .button:hover,
.woocommerce button.button:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: #ffffff;
}

.button-secondary {
  background-color: var(--color-secondary);
}

.button-secondary:hover {
  background-color: var(--color-primary);
}

.button-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.button-outline:hover {
  background-color: var(--color-accent);
  color: #ffffff;
}

/* ============================================
   FORMS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--color-primary);
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-top {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: var(--spacing-xs) 0;
  font-size: 0.875rem;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.header-top a {
  color: #ffffff;
}

.header-main {
  padding: var(--spacing-sm) 0;
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.site-logo {
  flex-shrink: 0;
}

.site-logo a {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.site-logo img {
  max-height: 50px;
  width: auto;
}

/* Navigation */
.main-navigation {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.main-navigation ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width var(--transition-base);
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
  width: 100%;
}

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

.header-search,
.header-account,
.header-cart {
  padding: 0.5rem;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.header-search:hover,
.header-account:hover,
.header-cart:hover {
  color: var(--color-accent);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: var(--color-accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 4px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
  background-color: var(--color-primary);
  color: #ffffff;
  padding: var(--spacing-2xl) 0 var(--spacing-sm);
}

.footer-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-widget h3 {
  color: #ffffff;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-md);
}

.footer-widget ul {
  list-style: none;
}

.footer-widget li {
  margin-bottom: var(--spacing-xs);
}

.footer-widget a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition-fast);
}

.footer-widget a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-section h1 {
  color: #ffffff;
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

.hero-section p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.9;
}

/* ============================================
   PRODUCT GRID
   ============================================ */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.product-card {
  background-color: var(--color-background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  overflow: hidden;
  padding-top: 100%;
  background-color: var(--color-background-alt);
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.product-info {
  padding: var(--spacing-md);
}

.product-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--color-primary);
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.product-price del {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-right: var(--spacing-xs);
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================ */

/* Tablet: 768px and up */
@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 2.5rem; }

  .section {
    padding: var(--spacing-xl) 0;
  }
}

/* Desktop: 1024px and up */
@media (min-width: 1024px) {
  h1 { font-size: 3.5rem; }

  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile: Below 768px */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: block;
  }

  .main-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-background);
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
  }

  .main-navigation.active {
    display: block;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0;
  }

  .main-navigation li {
    border-bottom: 1px solid var(--color-border);
  }

  .main-navigation a {
    display: block;
    padding: var(--spacing-sm) var(--container-padding);
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .hero-section p {
    font-size: 1rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .mobile-menu-toggle {
    display: none;
  }
}
