/**
 * WooCommerce Dark Mode Overrides
 * 
 * Styles to make WooCommerce blocks work with SAW LMS dark theme
 */

/* ================================
   NOTICE BANNERS - CRITICAL FIXES
   ================================ */

/* Target ALL WooCommerce notice containers */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error,
.wc-block-components-notices .wc-block-components-notice-banner,
.wc-block-components-notice-banner,
div.woocommerce-message,
div.woocommerce-info,
div.woocommerce-error {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 1rem 1.25rem !important;
    margin-bottom: 1rem !important;
}

/* Success notices - green tint */
.wc-block-components-notice-banner.is-success,
.woocommerce-message {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Info notices - indigo tint */
.wc-block-components-notice-banner.is-info,
.woocommerce-info {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Error notices - red tint */
.wc-block-components-notice-banner.is-error,
.woocommerce-error {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

/* Text inside notices */
.wc-block-components-notice-banner__content,
.wc-block-components-notice-banner p,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
    color: #e2e8f0 !important;
}

/* Links in notices */
.wc-block-components-notice-banner a,
.woocommerce-message a,
.woocommerce-info a {
    color: #a5b4fc !important;
    text-decoration: underline !important;
}

/* Icons in notices - hide default WC icons */
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    display: none !important;
}

/* ================================
   COUPON TOGGLE - DARK MODE
   ================================ */
.checkout-coupon-toggle,
.wc-block-components-panel,
.woocommerce-form-coupon-toggle,
.showcoupon,
.wc-block-checkout__actions button.wc-block-components-button--link {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border: 1px solid #334155 !important;
    border-radius: 12px !important;
    padding: 1rem 1.25rem !important;
}

.woocommerce-form-coupon-toggle .woocommerce-info,
.showcoupon {
    background: #1e293b !important;
}

.showcoupon {
    color: #a5b4fc !important;
}

/* ================================
   CART ITEM DETAILS - LICENSE BREAKDOWN
   ================================ */
.saw-cart-license-breakdown {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.saw-cart-license-breakdown__title {
    font-weight: 600;
    color: #a5b4fc;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saw-cart-license-breakdown__title svg {
    width: 16px;
    height: 16px;
}

.saw-cart-license-breakdown__row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: #94a3b8;
}

.saw-cart-license-breakdown__row--total {
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-weight: 600;
    color: #e2e8f0;
}

.saw-cart-license-breakdown__row span:last-child {
    font-weight: 500;
    color: #e2e8f0;
}

/* ================================
   FORMS - DARK MODE
   ================================ */
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-textarea textarea {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

.wc-block-components-text-input input:focus,
.wc-block-components-textarea textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
    outline: none !important;
}

.wc-block-components-text-input label {
    color: #94a3b8 !important;
}

/* Select/Combobox */
.wc-block-components-combobox .components-form-token-field__input-container,
.wc-block-components-combobox__control,
.wc-block-components-country-input .components-combobox-control__input {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
}

.wc-block-components-combobox__control input {
    color: #e2e8f0 !important;
}

/* ================================
   ORDER SUMMARY
   ================================ */
.wc-block-components-order-summary {
    background: transparent !important;
}

.wc-block-components-order-summary-item {
    border-bottom: 1px solid #334155 !important;
}

.wc-block-components-order-summary-item__description {
    color: #e2e8f0 !important;
}

.wc-block-components-totals-wrapper,
.wc-block-components-totals-footer-item {
    border-color: #334155 !important;
}

.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    color: #e2e8f0 !important;
}

/* ================================
   HIDE SHIPPING (for virtual products)
   ================================ */
.wc-block-components-shipping-rates-control,
.wc-block-components-shipping-address,
.wc-block-components-totals-shipping {
    display: none !important;
}

/* ================================
   PAYMENT METHODS
   ================================ */
.wc-block-components-radio-control__option {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 10px !important;
    margin-bottom: 0.5rem !important;
}

.wc-block-components-radio-control__option:hover {
    border-color: #6366f1 !important;
}

.wc-block-components-radio-control__label,
.wc-block-components-payment-method-label {
    color: #e2e8f0 !important;
}

.wc-block-components-radio-control__description,
.wc-block-components-payment-method-icons {
    color: #94a3b8 !important;
}

/* Radio button itself */
.wc-block-components-radio-control__input {
    border-color: #6366f1 !important;
}

.wc-block-components-radio-control__input:checked {
    background: #6366f1 !important;
}

/* ================================
   BUTTONS
   ================================ */
.wc-block-components-button:not(.wc-block-components-button--link),
.wc-block-components-checkout-place-order-button {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    padding: 1rem 2rem !important;
}

.wc-block-components-button:not(.wc-block-components-button--link):hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
}

/* ================================
   CART PAGE SPECIFIC
   ================================ */
.wc-block-cart .wc-block-components-product-name {
    color: #e2e8f0 !important;
}

.wc-block-cart .wc-block-components-product-metadata {
    color: #94a3b8 !important;
}

.wc-block-cart .wc-block-components-product-price {
    color: #a5b4fc !important;
}

/* Remove button */
.wc-block-cart__submit-container .wc-block-components-button {
    width: 100% !important;
}

/* Quantity selector in cart */
.wc-block-components-quantity-selector {
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
}

.wc-block-components-quantity-selector input {
    color: #e2e8f0 !important;
    background: transparent !important;
}

.wc-block-components-quantity-selector button {
    color: #e2e8f0 !important;
}

/* ================================
   THANK YOU / ORDER RECEIVED PAGE
   ================================ */

/* Main container - center like cart */
.woocommerce-order-received .woocommerce,
.woocommerce-order-received .entry-content {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 2rem 1.5rem !important;
}

/* Page title - hide default or style */
.woocommerce-order-received .entry-title,
.woocommerce-order-received h1.entry-title {
    text-align: center !important;
    color: #f1f5f9 !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-bottom: 1.5rem !important;
}

/* Success message box */
.woocommerce-thankyou-order-received,
.woocommerce-order-received .woocommerce-thankyou-order-received {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    border-radius: 16px !important;
    padding: 1.25rem 1.5rem !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

/* Order overview card */
.woocommerce-order-overview,
ul.woocommerce-order-overview {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    margin: 0 0 1.5rem 0 !important;
    list-style: none !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 1rem !important;
}

.woocommerce-order-overview li {
    text-align: center !important;
    padding: 0.75rem !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
    border: none !important;
    margin: 0 !important;
}

.woocommerce-order-overview li::before {
    display: none !important;
}

.woocommerce-order-overview li {
    color: #94a3b8 !important;
    font-size: 0.8125rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.woocommerce-order-overview li strong {
    display: block !important;
    color: #f1f5f9 !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin-top: 0.375rem !important;
}

/* Order details section */
.woocommerce-order-details {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

/* Section headings */
.woocommerce-order-details__title,
h2.woocommerce-order-details__title,
.woocommerce-column__title,
.woocommerce-order-received h2,
.woocommerce-order-received .woocommerce h2 {
    color: #f1f5f9 !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin: 0 0 1rem 0 !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #334155 !important;
}

/* Order table */
.woocommerce-table--order-details,
table.order_details,
.woocommerce-order-received table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
    background: transparent !important;
}

.woocommerce-table--order-details thead,
.order_details thead {
    display: none !important;
}

.woocommerce-table--order-details tbody tr,
.order_details tbody tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid #334155 !important;
}

.woocommerce-table--order-details tbody tr:last-child,
.order_details tbody tr:last-child {
    border-bottom: none !important;
}

.woocommerce-table--order-details td,
.order_details td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.woocommerce-table--order-details .product-name,
.order_details .product-name {
    color: #f1f5f9 !important;
    font-weight: 500 !important;
}

.woocommerce-table--order-details .product-name a,
.order_details .product-name a {
    color: #a5b4fc !important;
    text-decoration: none !important;
}

.woocommerce-table--order-details .product-name a:hover {
    text-decoration: underline !important;
}

.woocommerce-table--order-details .product-total,
.order_details .product-total {
    color: #6ee7b7 !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

/* Table footer (totals) */
.woocommerce-table--order-details tfoot tr,
.order_details tfoot tr {
    display: flex !important;
    justify-content: space-between !important;
    padding: 0.5rem 0 !important;
    border: none !important;
}

.woocommerce-table--order-details tfoot tr:first-child,
.order_details tfoot tr:first-child {
    border-top: 1px solid #334155 !important;
    margin-top: 0.5rem !important;
    padding-top: 1rem !important;
}

.woocommerce-table--order-details tfoot th,
.woocommerce-table--order-details tfoot td,
.order_details tfoot th,
.order_details tfoot td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    text-align: left !important;
}

.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #f1f5f9 !important;
}

.woocommerce-table--order-details tfoot tr:last-child td {
    color: #a5b4fc !important;
}

/* Customer details */
.woocommerce-customer-details {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.woocommerce-columns--addresses {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
}

.woocommerce-column--billing-address,
.woocommerce-column--shipping-address {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
    padding: 1rem !important;
    border: none !important;
}

.woocommerce-column__title {
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #94a3b8 !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0 !important;
    border: none !important;
}

.woocommerce-column address,
.woocommerce-customer-details address {
    color: #e2e8f0 !important;
    font-style: normal !important;
    line-height: 1.6 !important;
    font-size: 0.9375rem !important;
}

.woocommerce-column address p {
    margin: 0 !important;
    color: #e2e8f0 !important;
}

/* Bank transfer details box */
.woocommerce-bacs-bank-details,
.bacs_details,
section.woocommerce-bacs-bank-details {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.08)) !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    border-radius: 16px !important;
    padding: 1.25rem !important;
    margin: 1rem 0 1.5rem !important;
}

.woocommerce-bacs-bank-details h2,
.bacs_details h2 {
    color: #a5b4fc !important;
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
    padding-bottom: 0 !important;
    border: none !important;
}

.woocommerce-bacs-bank-details h3 {
    color: #f1f5f9 !important;
    font-size: 0.9375rem !important;
    margin: 0.75rem 0 0.5rem !important;
}

.woocommerce-bacs-bank-details ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-bacs-bank-details li {
    display: flex !important;
    justify-content: space-between !important;
    padding: 0.375rem 0 !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
    font-size: 0.9375rem !important;
    color: #94a3b8 !important;
}

.woocommerce-bacs-bank-details li:last-child {
    border-bottom: none !important;
}

.woocommerce-bacs-bank-details li strong {
    color: #f1f5f9 !important;
    font-weight: 600 !important;
}

/* All text in order-received */
.woocommerce-order-received p,
.woocommerce-order-received span,
.woocommerce-order-received label,
.woocommerce-order-received .woocommerce p {
    color: #94a3b8 !important;
}

/* Hide unnecessary elements */
.woocommerce-order-received .woocommerce-order>p:first-of-type {
    display: none !important;
}