/*
Theme Name: Bangladesh Ecommerce
Theme URI: https://bangladeshecommerce.com
Author: Bangladesh Ecommerce
Author URI: https://bangladeshecommerce.com
Description: A complete WooCommerce theme for Bangladesh Ecommerce - দেশীয় পণ্য, দেশের গর্ব
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: bangladesh-ecommerce
Tags: e-commerce, woocommerce, responsive, bangla, bangladesh
WC requires at least: 7.0
WC tested up to: 8.5
*/

/* =============================================
   CSS VARIABLES
============================================= */
:root {
  --primary: #1a7a3c;
  --primary-dark: #145f2e;
  --primary-light: #e8f5ee;
  --primary-hover: #0f4a24;
  --secondary: #f8b500;
  --accent-red: #e53935;
  --text-dark: #1a1a1a;
  --text-medium: #444444;
  --text-light: #777777;
  --border: #e0e0e0;
  --bg-light: #f5f5f5;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --transition: all 0.25s ease;
  --font-bangla: 'Hind Siliguri', 'SolaimanLipi', sans-serif;
}

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-bangla);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

.view-all {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.view-all:hover { color: var(--primary-dark); }

/* =============================================
   TOP BAR
============================================= */
#top-bar {
  background: var(--primary-dark);
  color: var(--white);
  font-size: 12px;
  padding: 7px 0;
  position: relative;
  z-index: 1001;
}

#top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-flag {
  width: 18px;
  height: 12px;
  background: linear-gradient(to bottom, #006a4e 50%, #006a4e 50%);
  position: relative;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.topbar-center i { color: var(--secondary); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =============================================
   HEADER
============================================= */
#desktop-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

#desktop-header.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
}

#site-header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-main {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.header-main .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo — always leftmost, fixed width */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: auto; /* push everything else to the right */
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.logo-text span {
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 500;
}

/* Search — grows to fill middle space */
.header-search {
  flex: 1;
  max-width: 580px;
}

.search-form {
  display: flex;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  height: 44px;
}

.search-input {
  flex: 1;
  padding: 0 16px;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: var(--font-bangla);
  color: var(--text-dark);
}

.search-category {
  padding: 0 12px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  outline: none;
  font-family: var(--font-bangla);
  font-size: 13px;
  color: var(--text-medium);
  background: var(--bg-light);
  cursor: pointer;
  min-width: 120px;
}

.search-btn {
  width: 50px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover { background: var(--primary-dark); }

/* Header Actions — pinned to the right */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

.header-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-medium);
  font-size: 13px;
  transition: var(--transition);
}

.header-action-item:hover { color: var(--primary); }

.action-icon {
  position: relative;
  font-size: 20px;
}

.action-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.header-login {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-medium);
  font-size: 13px;
  cursor: pointer;
}
.header-login:hover { color: var(--primary); }

/* =============================================
   NAVIGATION
============================================= */
#main-nav {
  background: var(--primary);
  position: relative;
}

#main-nav .container {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

/* Category Dropdown Toggle */
.cat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: rgba(0,0,0,0.15);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-bangla);
  border: none;
  transition: var(--transition);
  min-width: 160px;
  height: 46px;
}

.cat-toggle:hover { background: rgba(0,0,0,0.25); }

.cat-toggle i { font-size: 16px; }
.cat-toggle .arrow { margin-left: auto; font-size: 12px; transition: var(--transition); }
.cat-toggle.active .arrow { transform: rotate(180deg); }

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 46px;
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: white;
  background: rgba(0,0,0,0.15);
}

/* Category Mega Menu */
.cat-mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  background: white;
  box-shadow: var(--shadow-hover);
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 999;
  display: none;
  border-top: 3px solid var(--primary);
}

.cat-mega-menu.open { display: block; }

.cat-mega-menu ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-medium);
  border-bottom: 1px solid var(--bg-light);
  transition: var(--transition);
}

.cat-mega-menu ul li a:hover {
  color: var(--primary);
  background: var(--primary-light);
  padding-left: 26px;
}

/* =============================================
   FOOTER
============================================= */
#site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  margin-top: 60px;
}

/* Newsletter */
.footer-newsletter {
  background: var(--primary);
  padding: 30px 0;
}

.footer-newsletter .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.newsletter-text {
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}

.newsletter-icon {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.newsletter-text h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.newsletter-text p {
  font-size: 13px;
  opacity: 0.85;
}

.newsletter-form {
  display: flex;
  gap: 0;
  flex: 1;
  max-width: 500px;
}

.newsletter-input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  outline: none;
  font-family: var(--font-bangla);
  font-size: 14px;
  border-radius: var(--radius) 0 0 var(--radius);
}

.newsletter-btn {
  padding: 12px 24px;
  background: var(--primary-dark);
  color: white;
  border: none;
  font-family: var(--font-bangla);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: var(--transition);
  white-space: nowrap;
}

.newsletter-btn:hover { background: #0a3518; }

/* Footer Main */
.footer-main {
  padding: 50px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
  gap: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.footer-logo-text h3 {
  font-size: 17px;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.footer-logo-text span {
  font-size: 12px;
  opacity: 0.7;
}

.footer-about p {
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.8;
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
  transition: var(--transition);
}

.social-link:hover { background: var(--primary); transform: translateY(-2px); }

.footer-col h4 {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links li a {
  font-size: 13px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.footer-links li a::before {
  content: '›';
  color: var(--primary-light);
  font-size: 16px;
}

.footer-links li a:hover {
  opacity: 1;
  color: white;
  padding-left: 4px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
  opacity: 0.85;
}

.footer-contact li i {
  color: var(--secondary);
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
}

.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 13px;
  opacity: 0.7;
}

.payment-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.payment-icon {
  background: white;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  height: 24px;
}

.payment-icon.bkash { color: #e2136e; }
.payment-icon.nagad { color: #f05a24; }
.payment-icon.rocket { color: #8b008b; }
.payment-icon.visa { color: #1a1f71; }
.payment-icon.mc { color: #eb001b; }

/* =============================================
   MOBILE NAV
============================================= */
.mobile-header {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.mobile-header-top {
  background: var(--primary-dark);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255,255,255,0.9);
}

.mobile-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.mobile-logo-text h2 {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.mobile-logo-text span {
  font-size: 10px;
  color: var(--text-light);
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-action-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-dark);
  cursor: pointer;
  position: relative;
  padding: 4px;
}

.mobile-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 8px 0 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 11px;
  font-family: var(--font-bangla);
  transition: var(--transition);
  padding: 4px 12px;
  border-radius: var(--radius);
}

.mobile-nav-item i { font-size: 20px; }

.mobile-nav-item.active,
.mobile-nav-item:hover { color: var(--primary); }

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100%;
  background: white;
  z-index: 2000;
  overflow-y: auto;
  transition: left 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.mobile-drawer.open { left: 0; }

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  display: none;
}

.drawer-overlay.open { display: block; }

.drawer-header {
  background: var(--primary);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
}

.drawer-user {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.drawer-user a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
}

.drawer-nav {
  padding: 10px 0;
}

.drawer-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-medium);
  border-bottom: 1px solid var(--bg-light);
  transition: var(--transition);
}

.drawer-nav li a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.drawer-nav li a i {
  width: 20px;
  color: var(--primary);
}

/* =============================================
   UTILITIES / BUTTONS
============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-bangla);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,122,60,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 991px) {
  #top-bar { display: none; }
  #desktop-header { display: none; }
  #site-header { display: none; }
  #main-nav { display: none; }
  .mobile-header { display: block; }
  .mobile-bottom-nav { display: block; }

  body { padding-bottom: 70px; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-newsletter .container {
    flex-direction: column;
    align-items: flex-start;
  }

  .newsletter-form { max-width: 100%; width: 100%; }

  .footer-bottom .container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .container { padding: 0 16px; }
}

/* WooCommerce base compat */
.woocommerce-notices-wrapper { margin: 10px 0; }
.woocommerce-message, .woocommerce-error, .woocommerce-info {
  padding: 12px 20px;
  border-radius: var(--radius);
  margin: 10px 0;
  font-family: var(--font-bangla);
}
.woocommerce-message { background: var(--primary-light); border-left: 4px solid var(--primary); color: var(--primary-dark); }
.woocommerce-error { background: #ffeaea; border-left: 4px solid var(--accent-red); color: #c62828; }
.woocommerce-info { background: #e3f2fd; border-left: 4px solid #1976d2; color: #1565c0; }

/* =============================================
   CART LAYOUT — inline here to guarantee load
============================================= */
.be-woo-cart-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}
.woocommerce-cart .woocommerce,
.woocommerce-cart #page-content > .woocommerce {
  padding: 0 !important;
  margin: 0 auto !important;
  float: none !important;
  max-width: 1280px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}
.woocommerce-cart .cart-collaterals,
.woocommerce-cart .cart_totals,
.woocommerce-cart .cross-sells {
  float: none !important;
  width: 100% !important;
}
.be-cart-layout {
  display: grid !important;
  grid-template-columns: 1fr 340px !important;
  gap: 24px !important;
  align-items: start !important;
}
.be-order-summary {
  position: sticky;
  top: 100px;
}
@media (max-width: 1024px) {
  .be-cart-layout { grid-template-columns: 1fr 300px !important; }
}
@media (max-width: 768px) {
  .be-cart-layout { grid-template-columns: 1fr !important; }
  .be-cart-right  { order: -1; }
  .be-order-summary { position: static; }
}
