/*
 * Paiqari Wholesale - Main Stylesheet
 */

:root {
  --color-primary: #047857;
  --color-primary-container: #064E3B;
  --color-primary-light: #ECFDF5;
  --color-secondary: #D97706;
  --color-secondary-container: #FEF3C7;
  --color-surface: #F8FAFC;
  --color-surface-bright: #FFFFFF;
  --color-surface-container-low: #F1F5F9;
  --color-surface-container: #E2E8F0;
  --color-on-surface: #0F172A;
  --color-on-surface-variant: #475569;
  --color-outline: #94A3B8;
  --color-outline-variant: #CBD5E1;
  --color-error: #DC2626;
  --font-display: 'Outfit', 'Hind Siliguri', sans-serif;
  --font-body: 'Work Sans', 'Hind Siliguri', sans-serif;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
}

/* Hide scrollbar for clean horizontal scrolls */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   Mega Dropdown Hover Bridge & Grace Delay (Part 1.3 & Part 6.3)
   ========================================================================== */
.wholesale-dropdown-wrapper {
  position: relative;
}

.wholesale-dropdown-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.35s ease;
  pointer-events: none;
  z-index: 100;
}

/* Hover Bridge: 24px invisible buffer between button and dropdown */
.wholesale-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 24px;
  background: transparent;
  display: block;
}

/* Active and Hover states */
.wholesale-dropdown-wrapper:hover .wholesale-dropdown-menu,
.wholesale-dropdown-wrapper:focus-within .wholesale-dropdown-menu,
.wholesale-dropdown-menu:hover,
.wholesale-dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.wholesale-dropdown-wrapper:hover .dropdown-caret,
.wholesale-dropdown-wrapper:focus-within .dropdown-caret {
  transform: rotate(180deg);
}

/* ==========================================================================
   WooCommerce Specific Overrides & Form Enhancements
   ========================================================================== */
.woocommerce-input-wrapper {
  width: 100%;
}

.woocommerce-input-wrapper input,
.woocommerce-input-wrapper select,
.woocommerce-input-wrapper textarea {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--color-surface-container);
  background-color: var(--color-surface-container-low);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-on-surface);
  transition: all 0.2s ease;
}

.woocommerce-input-wrapper input:focus,
.woocommerce-input-wrapper select:focus,
.woocommerce-input-wrapper textarea:focus {
  border-color: var(--color-primary);
  background-color: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
}

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Order Review Table */
.woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-surface-container);
}

.woocommerce-checkout-review-order-table th {
  font-weight: 700;
  color: var(--color-primary);
}

.woocommerce-checkout-review-order-table .order-total {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Payment Methods List */
#payment ul.payment_methods {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

#payment ul.payment_methods li {
  padding: 1rem;
  background-color: var(--color-surface-container-low);
  border: 1px solid var(--color-surface-container);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}

#payment ul.payment_methods li label {
  font-weight: 700;
  color: var(--color-on-surface);
  cursor: pointer;
  margin-left: 0.5rem;
}

#payment ul.payment_methods li .payment_box {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid var(--color-surface-container);
  font-size: 0.75rem;
  color: var(--color-on-surface-variant);
}

/* Place Order Button */
#place_order {
  width: 100%;
  background-color: var(--color-secondary) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  padding: 1rem !important;
  border-radius: 0.75rem !important;
  font-size: 1rem !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.3) !important;
  transition: all 0.2s ease !important;
}

#place_order:hover {
  background-color: #b45309 !important;
  transform: translateY(-1px);
}

/* Quantity input in WooCommerce cart */
.woocommerce .quantity .qty {
  width: 4rem;
  text-align: center;
  border-radius: 0.5rem;
  border: 1px solid var(--color-surface-container);
  padding: 0.4rem;
  font-weight: 700;
}

/* ==========================================================================
   Strict Logo Sizing Across All Pages & Devices
   ========================================================================== */
header img.paiqari-logo,
header .paiqari-logo,
.paiqari-logo,
header a img,
.woocommerce header img,
.woocommerce-page header img,
footer img.paiqari-logo {
  height: 32px !important;
  max-height: 32px !important;
  width: auto !important;
  max-width: 130px !important;
  object-fit: contain !important;
  display: inline-block !important;
}

/* ==========================================================================
   Cross-Device Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
  html {
    overflow-x: clip !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  body {
    overflow-x: clip !important;
    min-height: 100% !important;
    width: 100% !important;
    touch-action: pan-y !important;
  }
  
  header {
    width: 100% !important;
  }
  
  /* Horizontal scrollbars hidden but smooth touch swipe */
  .no-scrollbar,
  .overflow-x-auto {
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .no-scrollbar::-webkit-scrollbar,
  .overflow-x-auto::-webkit-scrollbar {
    display: none;
  }

  /* Responsive product and layout tables */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Buttons touch friendly */
  button, .button, a.btn {
    min-height: 42px;
  }
}

/* Wholesale Dropdown Reliability */
.wholesale-dropdown-wrapper {
  position: relative !important;
}
.wholesale-dropdown-menu {
  display: none;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  z-index: 99999 !important;
}
.wholesale-dropdown-wrapper:hover .wholesale-dropdown-menu,
.wholesale-dropdown-menu:hover,
.wholesale-dropdown-menu.is-open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
