/**
 * WooCommerce Dark Tech Marketplace Stylesheet
 *
 * Fully custom dark UI for Cart, Checkout, Tables, Inputs, and Gateways.
 * Replaces legacy WooCommerce float styles with clean flexbox/grid primitives.
 *
 * @package CodePaks
 * @version 1.0.0
 */

/* ==========================================================================
   1. Form Inputs, Select2 & Controls (Dark Tech Overrides)
   ========================================================================== */
.woocommerce form .form-row {
  margin-bottom: 1.25rem;
  padding: 0;
}

.woocommerce form .form-row label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.375rem;
}

.woocommerce form .form-row label .required {
  color: #f43f5e;
  text-decoration: none;
}

.woocommerce-input-wrapper {
  display: block;
  width: 100%;
}

.woocommerce form input.input-text,
.woocommerce form textarea,
.woocommerce form select {
  width: 100% !important;
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(51, 65, 85, 0.8) !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.875rem !important;
  color: #f8fafc !important;
  outline: none !important;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.woocommerce form input.input-text:focus,
.woocommerce form textarea:focus,
.woocommerce form select:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2) !important;
  background-color: #0f172a !important;
}

/* Select2 Custom Dark Styling (Country Dropdown) */
.select2-container--default .select2-selection--single {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(51, 65, 85, 0.8) !important;
  border-radius: 0.75rem !important;
  height: 46px !important;
  padding: 0.5rem 0.75rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f8fafc !important;
  line-height: 28px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px !important;
}

.select2-dropdown {
  background-color: #0f172a !important;
  border: 1px solid #334155 !important;
  border-radius: 0.75rem !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.8) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: #06b6d4 !important;
  color: #020617 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  background-color: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #ffffff !important;
  border-radius: 0.5rem !important;
}

/* ==========================================================================
   2. Cart & Checkout Grid Structure
   ========================================================================== */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce {
  max-width: 80rem;
  margin: 0 auto;
}

/* Two-Column Checkout Layout */
@media (min-width: 1024px) {
  .woocommerce-checkout form.checkout {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 3rem;
    align-items: start;
  }
}

/* Order Review & Payment Card (Right Column) */
#order_review,
.cart-collaterals .cart_totals {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(30, 41, 59, 0.8) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  backdrop-filter: blur(8px) !important;
}

/* Tables Styling */
.woocommerce table.shop_table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: 1px solid rgba(30, 41, 59, 0.8) !important;
  border-radius: 1rem !important;
  background-color: rgba(15, 23, 42, 0.4) !important;
  overflow: hidden !important;
  margin-bottom: 2rem !important;
}

.woocommerce table.shop_table th {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  font-family: var(--font-sans) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 1rem !important;
  border-bottom: 1px solid #1e293b !important;
}

.woocommerce table.shop_table td {
  padding: 1rem !important;
  border-top: 1px solid rgba(30, 41, 59, 0.6) !important;
  color: #cbd5e1 !important;
}

/* ==========================================================================
   3. Buttons & Conversion Calls-to-Action
   ========================================================================== */
.woocommerce #payment #place_order,
.woocommerce .cart-collaterals .checkout-button,
.woocommerce button.button.alt,
.woocommerce a.button.alt {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  background-color: #06b6d4 !important;
  color: #020617 !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  padding: 0.875rem 1.5rem !important;
  border-radius: 0.75rem !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 200ms ease !important;
  box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.3) !important;
}

.woocommerce #payment #place_order:hover,
.woocommerce .cart-collaterals .checkout-button:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover {
  background-color: #22d3ee !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 15px 25px -5px rgba(6, 182, 212, 0.4) !important;
}

/* ==========================================================================
   4. Notices & Alert Banners
   ========================================================================== */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
  border-radius: 0.75rem !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: 1.5rem !important;
  font-size: 0.875rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

.woocommerce-error {
  background-color: rgba(244, 63, 94, 0.1) !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
  color: #fda4af !important;
}

.woocommerce-message {
  background-color: rgba(52, 211, 153, 0.1) !important;
  border: 1px solid rgba(52, 211, 153, 0.3) !important;
  color: #6ee7b7 !important;
}

.woocommerce-info {
  background-color: rgba(6, 182, 212, 0.1) !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  color: #67e8f9 !important;
}

/* ==========================================================================
   5. Catalog Ordering & Result Counter Overrides
   ========================================================================== */
.woocommerce-ordering select.orderby {
  background-color: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid rgba(51, 65, 85, 0.8) !important;
  border-radius: 0.75rem !important;
  color: #f8fafc !important;
  font-size: 0.8125rem !important;
  font-family: var(--font-sans) !important;
  padding: 0.5rem 2rem 0.5rem 0.875rem !important;
  outline: none !important;
  cursor: pointer !important;
}

.woocommerce-ordering select.orderby:focus {
  border-color: #06b6d4 !important;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2) !important;
}

.woocommerce-result-count {
  font-size: 0.75rem !important;
  font-family: var(--font-sans) !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin: 0 !important;
}

/* ==========================================================================
   6. Single Product Asymmetric Grid & Sticky Buy Box Primitives
   ========================================================================== */
.lg\:grid-cols-12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

@media (min-width: 1024px) {
  .lg\:col-span-7 {
    grid-column: span 7 / span 7;
  }
  .lg\:col-span-5 {
    grid-column: span 5 / span 5;
  }
  .top-24 {
    top: 6rem;
  }
}

/* Ensure Single Product Native Add-to-Cart form is full width */
.woocommerce div.product form.cart {
  margin-bottom: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
  width: 100% !important;
  border-radius: 0.75rem !important;
  padding: 0.875rem 1.5rem !important;
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  background-color: #06b6d4 !important;
  color: #020617 !important;
  box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.3) !important;
  transition: all 200ms ease !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover {
  background-color: #22d3ee !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 15px 25px -5px rgba(6, 182, 212, 0.4) !important;
}

/* ==========================================================================
   7. Asynchronous Toast Notification & Micro-Animation Primitives
   ========================================================================== */
.fixed { position: fixed; }
.bottom-6 { bottom: 1.5rem; }
.right-6 { right: 1.5rem; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.translate-y-3 { transform: translateY(0.75rem); }
.translate-y-0 { transform: translateY(0); }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.scale-125 { transform: scale(1.25); }
.cursor-wait { cursor: wait; }

.codepaks-toast {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 0 15px rgba(6, 182, 212, 0.15) !important;
}

/* ==========================================================================
   8. High-Priority Floating Dark Toast Layer
   ========================================================================== */
#codepaks-toast-container {
  position: fixed !important;
  bottom: 1.5rem !important;
  right: 1.5rem !important;
  z-index: 999999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  pointer-events: none !important;
}

.codepaks-toast {
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.25rem !important;
  padding: 0.875rem 1.25rem !important;
  border-radius: 0.75rem !important;
  background-color: #0f172a !important;
  border: 1px solid rgba(6, 182, 212, 0.5) !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.9), 0 0 20px rgba(6, 182, 212, 0.25) !important;
  transform: translateY(1rem) scale(0.95);
  opacity: 0;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.codepaks-toast.is-visible {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

.codepaks-toast .toast-content {
  display: flex !important;
  align-items: center !important;
  gap: 0.625rem !important;
}

.codepaks-toast .toast-icon {
  width: 1.5rem !important;
  height: 1.5rem !important;
  border-radius: 0.5rem !important;
  background-color: rgba(6, 182, 212, 0.15) !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #22d3ee !important;
  flex-shrink: 0 !important;
}

.codepaks-toast .toast-icon svg {
  width: 0.875rem !important;
  height: 0.875rem !important;
}

.codepaks-toast .toast-text {
  font-family: var(--font-sans) !important;
  font-size: 0.8125rem !important;
  color: #e2e8f0 !important;
}

.codepaks-toast .toast-btn {
  padding: 0.375rem 0.75rem !important;
  border-radius: 0.5rem !important;
  background-color: #06b6d4 !important;
  color: #020617 !important;
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  font-size: 0.6875rem !important;
  text-decoration: none !important;
  transition: background-color 150ms ease !important;
  white-space: nowrap !important;
}

.codepaks-toast .toast-btn:hover {
  background-color: #22d3ee !important;
}

/* ==========================================================================
   CodePaks Single Product Scoped Typography & Interactive Engine
   ========================================================================== */

/* 1. Scrollbar Configuration */
.codepaks-scroll::-webkit-scrollbar { width: 4px; }
.codepaks-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 9999px; }
.codepaks-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
.codepaks-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 2. H2 Typography & SVG Alignment */
.codepaks-prose h2 {
    font-size: 1.3rem !important;
    font-weight: 800 !important;
    color: #0b0e1c !important;
    margin-top: 2rem !important;
    margin-bottom: 0.85rem !important;
    line-height: 1.35 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    letter-spacing: -0.02em !important;
}
.codepaks-prose h2 svg,
.codepaks-prose h3 svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    stroke: #2436e4 !important;
    color: #2436e4 !important;
    flex-shrink: 0 !important;
}

/* 3. FAQ Details Accordion -> Primary Blue Overrides */
.codepaks-prose details[open] {
    border-color: rgba(36, 54, 228, 0.45) !important;
    box-shadow: 0 4px 14px -2px rgba(36, 54, 228, 0.12) !important;
}
.codepaks-prose details summary::after {
    border-right-color: #2436e4 !important;
    border-bottom-color: #2436e4 !important;
}

/* 4. Subheadings (H3-H6) */
.codepaks-prose h3 {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.6rem !important;
    line-height: 1.4 !important;
}
.codepaks-prose h4 {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}
.codepaks-prose h5 {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
}
.codepaks-prose h6 {
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.35rem !important;
}

/* 5. Paragraphs and Lists (Brand Blue Checkmark Override) */
.codepaks-prose p {
    margin-bottom: 1rem !important;
    line-height: 1.65 !important;
    color: #55607d !important;
}
.codepaks-prose ul {
    padding-left: 1.4rem !important;
    margin-bottom: 1.25rem !important;
}
.codepaks-prose ol {
    list-style-type: decimal !important;
    padding-left: 1.4rem !important;
    margin-bottom: 1.25rem !important;
}
.codepaks-prose li {
    margin-bottom: 0.4rem !important;
    line-height: 1.6 !important;
    color: #334155 !important;
}
/* Override main.css ::before with Electric Blue Checkmark */
.codepaks-prose ul > li::before {
    background-color: rgba(36, 54, 228, 0.10) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232436e4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") !important;
}

/* 6. Clean Tables */
.codepaks-prose table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    font-size: 0.875rem !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
}
.codepaks-prose th {
    background-color: #f8fafc !important;
    color: #0b0e1c !important;
    font-weight: 700 !important;
    padding: 0.75rem 1rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
    text-align: left !important;
}
.codepaks-prose td {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #55607d !important;
}
.codepaks-prose tr:hover td {
    background-color: #f8fafc !important;
}

/* 7. Blockquote */
.codepaks-prose blockquote {
    border-left: 4px solid #2436e4 !important;
    background: #f8fafc !important;
    padding: 1rem 1.25rem !important;
    margin: 1.25rem 0 !important;
    border-radius: 0 0.75rem 0.75rem 0 !important;
    color: #334155 !important;
    font-style: italic !important;
}

/* 8. Inline Code & Pre */
.codepaks-prose code {
    background: rgba(36, 54, 228, 0.08) !important;
    color: #2436e4 !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.85em !important;
    font-family: inherit !important;
}
.codepaks-prose pre {
    background: #0b0e1c !important;
    color: #f8fafc !important;
    padding: 1rem 1.25rem !important;
    border-radius: 1rem !important;
    overflow-x: auto !important;
    margin: 1.25rem 0 !important;
    font-size: 0.85rem !important;
}
.codepaks-prose pre code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
}

/* 9. Hyperlinks */
.codepaks-prose hr {
    border: 0 !important;
    border-top: 1px solid #e2e8f0 !important;
    margin: 2rem 0 !important;
}
.codepaks-prose a {
    color: #2436e4 !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}
.codepaks-prose a:hover {
    color: #5b32e8 !important;
}

/* =========================================================================
   CodePaks Order Bump Electric Coral Radar Wave (100% GPU Composited CRO)
   ========================================================================= */
@keyframes cpk-radar-pulse {
    0% {
        transform: scale(1) translateZ(0);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.35, 1.6) translateZ(0);
        opacity: 0;
    }
    100% {
        transform: scale(1.35, 1.6) translateZ(0);
        opacity: 0;
    }
}

.cpk-radar-badge {
    position: relative;
    isolation: isolate;
}

.cpk-radar-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: #ff3366;
    z-index: -1;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform, opacity;
    animation: cpk-radar-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite !important;
}