/*
Theme Name: Sonwani Digital & Course Shop
Theme URI: https://courses.sonwani.online
Author: Sonwani Tech
Author URI: https://sonwani.online
Description: Complete, ultra-fast eCommerce, Course Selling & Digital Product WordPress Theme. Lightweight, fully WooCommerce ready, no page builders required.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sonwani-shop
Tags: e-commerce, courses, digital-products, two-columns, custom-menu, featured-images, full-width-template
*/

:root {
  --primary: #e31e24;
  --primary-hover: #b5121b;
  --dark: #0f172a;
  --text-muted: #64748b;
  --bg-soft: #f8fafc;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --radius: 12px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--dark); background: #fdfdfd; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.container { width: min(1200px, 92%); margin: auto; }

/* Header & Branding */
.site-header { background: #fff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 9999; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 75px; }

.site-branding {
  display: flex;
  align-items: center;
}

.custom-logo-link {
  display: inline-block;
  line-height: 0;
}

.custom-logo {
  max-height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-name { font-size: 22px; font-weight: 800; color: var(--dark); display: inline-block; }
.brand-name span { color: var(--primary); }

.desktop-nav-links { display: flex; align-items: center; gap: 20px; }
.main-menu-list { display: flex; list-style: none; gap: 22px; align-items: center; }
.main-menu-list a { font-weight: 600; font-size: 14px; color: #334155; transition: color 0.2s; }
.main-menu-list a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }

.btn-primary { background: var(--primary); color: #fff; padding: 10px 20px; border-radius: 8px; font-weight: 700; font-size: 14px; transition: 0.2s; border: none; display: inline-block; cursor: pointer; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-whatsapp { background: #25d366; color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 14px; display: inline-block; }
.mobile-toggle-btn { display: none; background: none; border: none; font-size: 26px; cursor: pointer; color: var(--dark); }

/* Live Cart Button in Header */
.cart-trigger-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(227, 30, 36, 0.2);
}

.header-cart-count {
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 50px;
}

/* Hero Section */
.hero-section { padding: 70px 0 50px; background: radial-gradient(circle at top right, #fff1f2 0%, #ffffff 70%); }
.hero-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.badge { display: inline-block; background: #fee2e2; color: var(--primary); padding: 6px 14px; border-radius: 50px; font-size: 13px; font-weight: 700; margin-bottom: 15px; }
.hero-text h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.25; font-weight: 800; margin-bottom: 16px; }
.hero-text h1 span { color: var(--primary); }
.hero-text p { font-size: 16px; color: var(--text-muted); margin-bottom: 25px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-card { display: flex; flex-direction: column; gap: 15px; background: #fff; padding: 30px; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.stat-box { border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; }
.stat-box:last-child { border-bottom: none; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 14px; color: var(--text-muted); }

/* Features Strip */
.features-strip { background: #fff; padding: 30px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-box { display: flex; align-items: center; gap: 15px; }
.feature-icon { font-size: 28px; background: #fff1f2; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 12px; }

/* Section Title */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 32px; font-weight: 800; }
.section-title p { color: var(--text-muted); }

/* Courses Section & Grid (3 Columns on Laptop) */
.courses-section { padding: 60px 0; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

.product-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
  border-color: #fca5a5;
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  overflow: hidden;
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-thumb {
  transform: scale(1.04);
}

.product-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 44px;
}

.pill { position: absolute; top: 12px; left: 12px; background: rgba(15,23,42,0.85); color: #fff; font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 700; }
.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.product-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 14px; }
.price-box { display: flex; align-items: baseline; gap: 8px; }
.price-tag { font-size: 20px; font-weight: 800; color: var(--primary); }
.old-price { text-decoration: line-through; color: #94a3b8; font-size: 13px; }
.buy-btn { background: var(--primary); color: #fff; padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.buy-btn:hover { background: var(--primary-hover); }

/* WooCommerce Digital Products - Laptop 4-Column Responsive Grid */
.wc-products-wrapper ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 22px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 25px 0 !important;
  float: none !important;
}

.wc-products-wrapper ul.products::before,
.wc-products-wrapper ul.products::after {
  display: none !important;
}

.wc-products-wrapper ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  text-align: center !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.wc-products-wrapper ul.products li.product:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.wc-products-wrapper ul.products li.product img {
  width: 100% !important;
  height: 180px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  margin-bottom: 12px !important;
}

.wc-products-wrapper ul.products li.product .woocommerce-loop-product__title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--dark) !important;
  margin-bottom: 8px !important;
}

.wc-products-wrapper ul.products li.product .price {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--primary) !important;
  margin-bottom: 12px !important;
  display: block !important;
}

.wc-products-wrapper ul.products li.product .button {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  margin-top: auto !important;
}

/* Slide Drawers (Left Menu & Right Cart) */
.site-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 99990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.site-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-left {
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 82vw);
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.mobile-drawer-left.active {
  transform: translateX(0);
}

.cart-drawer-right {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 88vw);
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.cart-drawer-right.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}
.drawer-title { font-size: 16px; font-weight: 800; color: var(--dark); }
.drawer-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b; line-height: 1; }
.drawer-content { padding: 20px; overflow-y: auto; flex-grow: 1; }

.drawer-menu-list { list-style: none; padding: 0; margin: 0 0 25px; }
.drawer-menu-list li { border-bottom: 1px solid #f1f5f9; }
.drawer-menu-list li a { display: block; padding: 13px 4px; font-size: 15px; font-weight: 600; color: #1e293b; }
.drawer-extra-links { border-top: 1px solid var(--border-color); padding-top: 20px; }
.drawer-btn { display: block; background: #f1f5f9; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 700; margin-bottom: 10px; text-align: center; }

/* WooCommerce Mini Cart in Drawer */
.cart-drawer-right .widget_shopping_cart_content { display: flex; flex-direction: column; height: 100%; }
.cart-drawer-right .woocommerce-mini-cart { list-style: none; padding: 0; margin: 0; flex-grow: 1; overflow-y: auto; }
.cart-drawer-right .woocommerce-mini-cart-item { padding: 12px 0; border-bottom: 1px solid #f1f5f9; position: relative; font-size: 14px; }
.cart-drawer-right .woocommerce-mini-cart__total { padding: 15px 0; border-top: 2px solid var(--border-color); font-size: 16px; font-weight: 800; display: flex; justify-content: space-between; }
.cart-drawer-right .woocommerce-mini-cart__buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.cart-drawer-right .woocommerce-mini-cart__buttons a.button { width: 100% !important; text-align: center !important; padding: 12px !important; border-radius: 8px !important; font-weight: 700 !important; font-size: 14px !important; }
.cart-drawer-right .woocommerce-mini-cart__buttons a.checkout { background: #16a34a !important; }

/* Custom Login & Registration Styling */
.auth-wrapper { display: flex; justify-content: center; align-items: center; padding: 60px 0; min-height: 75vh; }
.auth-card { background: #ffffff; border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.06); width: min(460px, 92%); overflow: hidden; margin: auto; }
.auth-tabs { display: flex; background: #f8fafc; border-bottom: 1px solid var(--border-color); }
.tab-btn { flex: 1; padding: 15px; font-size: 15px; font-weight: 700; border: none; background: transparent; cursor: pointer; color: #64748b; }
.tab-btn.active { background: #ffffff; color: var(--primary); border-bottom: 3px solid var(--primary); }
.auth-box { padding: 30px 24px; }
.auth-box h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-subtitle { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.form-group input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--border-color); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
.form-group input:focus { border-color: var(--primary); outline: none; }
.form-row-flex { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 20px; }
.remember-label { display: flex; align-items: center; gap: 6px; color: #64748b; cursor: pointer; }
.forgot-link { color: var(--primary); font-weight: 600; }
.auth-submit { width: 100%; padding: 12px; font-size: 15px; font-weight: 700; border-radius: 8px; background: var(--primary); color: #fff; border: none; cursor: pointer; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.hidden { display: none !important; }

/* Footer */
.site-footer { background: var(--dark); color: #94a3b8; padding: 50px 0 25px; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; font-size: 14px; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; text-align: center; font-size: 13px; }

/* Responsive Media Queries */
@media (max-width: 992px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .wc-products-wrapper ul.products { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 820px) {
  .mobile-toggle-btn { display: block; }
  .desktop-nav-links, .desktop-only-action { display: none !important; }
  .nav-wrap { display: flex; justify-content: space-between; align-items: center; }
  .hero-layout { grid-template-columns: 1fr; text-align: center; }
  .hero-btns { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .product-grid { grid-template-columns: 1fr; }
  .wc-products-wrapper ul.products { grid-template-columns: 1fr !important; }
  .custom-logo { max-height: 40px; }
}
/* Ensure Menu Button is Always Clickable */
.mobile-toggle-btn {
  display: block;
  position: relative;
  z-index: 10000;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 26px;
  border: none;
  background: transparent;
}

@media (min-width: 821px) {
  .mobile-toggle-btn {
    display: none !important;
  }
}