/*
 * WooCommerce Specific Styles
 */

/* Adjusting the WooCommerce layout inside the container */
.woocommerce div.product {
    margin-bottom: 30px;
}

/* Customizing Buttons to match theme */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background-color: var(--color-primary);
    color: #fff;
    border-radius: 4px;
    padding: 10px 20px;
    transition: background-color 0.3s ease;
}

.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background-color: var(--color-secondary);
    color: #fff;
}

/* Price color */
.woocommerce div.product p.price,
.woocommerce div.product span.price {
    color: var(--color-primary);
    font-weight: bold;
}

/* --- CART PAGE STYLES --- */

/* Modern Cart Layout */
@media (min-width: 992px) {
    .woocommerce-cart .woocommerce {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
    }

    .woocommerce-cart .woocommerce-cart-form {
        flex: 1 1 58%;
        max-width: 58%;
        order: 1;
        /* Left Column */
    }

    /* Target the un-wanted wrapper to act as if it's not there */
    .woocommerce-cart .cart-collaterals {
        display: contents;
    }

    .woocommerce-cart .cart-collaterals .cart_totals {
        flex: 1 1 38%;
        max-width: 38%;
        position: sticky;
        top: 40px;
        order: 2;
        /* Right Column */
    }

    /* Bring cross-sells down to full width below everything using Flex order */
    .woocommerce-cart .cart-collaterals .cross-sells {
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 50px;
        order: 3;
        /* Full width Bottom Row */
    }

    /* Fix WooCommerce Notices pushing flex items */
    .woocommerce-cart .woocommerce>.woocommerce-notices-wrapper,
    .woocommerce-cart .woocommerce>.woocommerce-message,
    .woocommerce-cart .woocommerce>.woocommerce-error,
    .woocommerce-cart .woocommerce>.woocommerce-info {
        flex: 1 1 100%;
        max-width: 100%;
        order: 0;
        /* Ensures notices always stay at the very top */
        margin-bottom: 30px;
        width: 100%;
    }
}

/* Cross-Sells Styling (Product Cards) */
.woocommerce-cart .cross-sells {
    padding-top: 20px;
    border-top: 1px solid #fcfcfc;
}

.woocommerce-cart .cross-sells h2 {
    font-size: 1.6em;
    margin-bottom: 25px;
    font-weight: 700;
    color: #222;
}

.woocommerce-cart .cross-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.woocommerce-cart .cross-sells ul.products li.product {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100% !important;
    /* Override explicit widths by WC */
    float: none !important;
    margin: 0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.woocommerce-cart .cross-sells ul.products li.product:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.woocommerce-cart .cross-sells ul.products li.product img {
    border-radius: 8px;
    margin-bottom: 15px;
    max-width: 100%;
    height: auto;
}

.woocommerce-cart .cross-sells ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.woocommerce-cart .cross-sells ul.products li.product .price {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
    margin-bottom: 15px;
}

.woocommerce-cart .cross-sells ul.products li.product .button {
    width: 100%;
    margin-top: auto;
    font-size: 0.9em;
    padding: 10px;
}

/* Cart Table Styling */
.woocommerce table.shop_table {
    border: none;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 30px;
}

.woocommerce table.shop_table th {
    background-color: transparent;
    border-bottom: 2px solid #eee;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    color: #666;
    padding: 15px 10px;
    text-align: left;
}

.woocommerce table.shop_table td {
    border-top: 1px solid #f0f0f0;
    padding: 20px 10px;
    vertical-align: middle;
}

/* Product Info in Cart */
.woocommerce table.shop_table td.product-thumbnail img {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    width: 80px;
    height: auto;
}

.woocommerce table.shop_table td.product-name a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.woocommerce table.shop_table td.product-name a:hover {
    color: var(--color-primary);
}

/* Remove Item Button */
.woocommerce a.remove {
    color: #ccc !important;
    background: transparent !important;
    font-size: 1.5em;
    font-weight: 300;
    line-height: 1;
    display: inline-block;
}

.woocommerce a.remove:hover {
    color: #ff4d4d !important;
    background: transparent !important;
}

/* Quantity Input */
.woocommerce .quantity .qty {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1em;
}

/* Coupon & Update Cart Section */
.woocommerce-cart-form__contents .actions {
    padding: 20px 0 !important;
    border-top: none;
}

.woocommerce .coupon {
    display: flex;
    gap: 10px;
}

.woocommerce .coupon input.input-text {
    width: 200px !important;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woocommerce .coupon button.button {
    background-color: #333;
}

.woocommerce .coupon button.button:hover {
    background-color: #111;
}

/* Cart Totals Box */
.woocommerce-cart .cart-collaterals .cart_totals {
    float: none;
    width: 100%;
    background: #fdfdfd;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.woocommerce-cart .cart-collaterals .cart_totals h2 {
    font-size: 1.5em;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    color: #333;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th,
.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table th {
    width: 40%;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
}

.woocommerce-cart .cart-collaterals .cart_totals table.shop_table td {
    text-align: right;
}

/* Proceed to Checkout Button */
.woocommerce .wc-proceed-to-checkout {
    padding-top: 25px;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
    display: block;
    text-align: center;
    font-size: 1.1em;
    padding: 15px 20px;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--color-primary) !important;
    color: #fff !important;
    transition: all 0.3s ease;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: var(--color-secondary) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* --- CHECKOUT PAGE STYLES --- */

/* Modern Checkout Layout (Two Columns on Desktop) */
@media (min-width: 992px) {
    .woocommerce-checkout form.checkout {
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        column-gap: 60px;
    }

    .woocommerce-checkout #customer_details {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        margin-bottom: 0;
        width: 100%;
    }

    .woocommerce-checkout #order_review_heading {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        margin-bottom: 15px;
        width: 100%;
    }

    .woocommerce-checkout #order_review {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        width: 100%;
        position: sticky;
        top: 40px;
    }
}

/* Fix Col2-set inner behavior */
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    width: 100%;
    max-width: 100%;
    float: none;
    margin-bottom: 30px;
}

/* Form Fields Styling (Premium Look) */
.woocommerce form .form-row {
    margin-bottom: 20px;
}

.woocommerce form .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95em;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    font-size: 1em;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) inset;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.woocommerce form .form-row textarea {
    min-height: 120px;
}

/* Select2 Customization (If active) */
.select2-container .select2-selection--single {
    height: 48px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
}

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

/* Order Review Table */
.woocommerce-checkout-review-order-table {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid #eee !important;
    margin-bottom: 30px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 20px 15px !important;
    border-bottom: 1px solid #f5f5f5 !important;
}

.woocommerce-checkout-review-order-table th {
    background-color: #fafafa;
    color: #333;
    font-weight: 600;
}

.woocommerce-checkout-review-order-table td {
    background-color: #fff;
}

.woocommerce-checkout-review-order-table tfoot th {
    text-align: left;
    background-color: #fff;
}

.woocommerce-checkout-review-order-table tfoot .order-total th,
.woocommerce-checkout-review-order-table tfoot .order-total td {
    border-top: 2px solid #eee !important;
    font-size: 1.25em;
    font-weight: 700;
    color: #111;
}

/* Payment Methods Area */
#add_payment_method #payment,
.woocommerce-cart #payment,
.woocommerce-checkout #payment {
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

#add_payment_method #payment ul.payment_methods,
.woocommerce-cart #payment ul.payment_methods,
.woocommerce-checkout #payment ul.payment_methods {
    border-bottom: 1px solid #eee;
    padding: 25px;
    margin: 0;
    background: #f9f9f9;
}

#add_payment_method #payment ul.payment_methods li,
.woocommerce-cart #payment ul.payment_methods li,
.woocommerce-checkout #payment ul.payment_methods li {
    line-height: 2;
    margin-bottom: 15px;
}

#add_payment_method #payment ul.payment_methods li:last-child,
.woocommerce-cart #payment ul.payment_methods li:last-child,
.woocommerce-checkout #payment ul.payment_methods li:last-child {
    margin-bottom: 0;
}

#add_payment_method #payment div.payment_box,
.woocommerce-cart #payment div.payment_box,
.woocommerce-checkout #payment div.payment_box {
    background-color: #fff;
    color: #666;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

#add_payment_method #payment div.payment_box::before,
.woocommerce-cart #payment div.payment_box::before,
.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: #eee;
    top: -11px;
}

/* Place Order Box & Button */
#add_payment_method #payment div.form-row,
.woocommerce-cart #payment div.form-row,
.woocommerce-checkout #payment div.form-row {
    padding: 30px;
    background: #fff;
    border-top: none;
}

#add_payment_method #payment div.form-row .button,
.woocommerce-cart #payment div.form-row .button,
.woocommerce-checkout #payment div.form-row .button {
    width: 100%;
    font-size: 1.15em;
    padding: 18px;
    border-radius: 8px;
    background-color: var(--color-primary);
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

#add_payment_method #payment div.form-row .button:hover,
.woocommerce-cart #payment div.form-row .button:hover,
.woocommerce-checkout #payment div.form-row .button:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Order Received (Thank You Page) Styles
   ========================================================================== */

/* Main wrapper spacing */
.woocommerce-checkout.woocommerce-order {
    max-width: 800px;
    margin: 0 auto;
}

/* Success Notice Box */
p.woocommerce-notice.woocommerce-notice--success.woocommerce-thankyou-order-received {
    background-color: #f0fdf4 !important;
    /* Tailwind green-50 */
    color: #166534 !important;
    /* Tailwind green-800 */
    border: 1px solid #bbf7d0 !important;
    border-radius: 12px;
    padding: 20px 25px 20px 60px;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(22, 101, 52, 0.05);
}

p.woocommerce-notice.woocommerce-notice--success::before {
    content: "✓";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #22c55e;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Order Overview / Summary Cards */
ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin: 0 0 45px 0;
    padding: 0;
    border: none;
    background: transparent;
}

ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 15px 10px;
    margin: 0;
    text-align: center;
    border-right: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s ease;
}

ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

/* Label */
ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.5px;
}

/* Value */
ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details li strong {
    display: block;
    margin-top: 8px;
    font-size: 1rem;
    color: var(--color-primary);
    text-transform: none;
    word-break: break-word;
    /* Prevents long emails from breaking the layout */
}

/* Special highlight for order number */
ul.woocommerce-order-overview li.woocommerce-order-overview__order strong {
    font-size: 1.3rem;
    color: var(--color-accent) !important;
}

/* Order Details Title */
h2.woocommerce-order-details__title,
.woocommerce-customer-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f1f1;
    color: var(--color-primary);
}

/* Clean up the Order Details Table */
table.woocommerce-table.woocommerce-table--order-details.shop_table.order_details {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
}

table.woocommerce-table--order-details thead th {
    background-color: #fafafa;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #666;
    padding: 18px 24px;
    border-bottom: 1px solid #eaeaea;
}

table.woocommerce-table--order-details tbody td {
    padding: 20px 24px;
    border-bottom: 1px solid #f5f5f5;
    background: #fff;
    vertical-align: middle;
}

/* Product Name Link */
table.woocommerce-table--order-details tbody td a {
    color: var(--color-primary);
    font-weight: 500;
}

/* Product Quantity */
table.woocommerce-table--order-details tbody td .product-quantity {
    color: #888;
    font-weight: normal;
}

/* Table Footer (Totals) */
table.woocommerce-table--order-details tfoot th,
table.woocommerce-table--order-details tfoot td {
    padding: 15px 24px;
    background-color: #fafafa;
    border-top: 1px solid #eaeaea;
    font-size: 0.95rem;
    color: var(--color-secondary);
}

table.woocommerce-table--order-details tfoot tr:last-child th,
table.woocommerce-table--order-details tfoot tr:last-child td {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    border-top: 2px solid #eaeaea;
    background-color: #fff;
    padding-top: 20px;
    padding-bottom: 20px;
}

/* Customer Details Section */
.woocommerce-customer-details {
    margin-top: 40px;
}

.woocommerce-customer-details address {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 25px;
    font-style: normal;
    line-height: 1.8;
    color: #555;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.woocommerce-customer-details address p {
    margin-bottom: 0;
}