/* ==========================================================================
   SEIK Cart & Checkout Enhancements
   ========================================================================== */

/* 1. Mini-Cart Dropdown & Off-Canvas: Checkout Button First */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons,
.dropdown-cart .woocommerce-mini-cart__buttons,
.cart-sidebar .woocommerce-mini-cart__buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 15px 0 5px 0 !important;
}

/* Primary "Checkout" / "Kassa" button placed FIRST */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons .checkout,
.dropdown-cart .woocommerce-mini-cart__buttons .checkout,
.cart-sidebar .woocommerce-mini-cart__buttons .checkout {
    order: 1 !important;
    display: block !important;
    width: 100% !important;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    text-align: center !important;
    padding: 12px 18px !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons .checkout:hover,
.dropdown-cart .woocommerce-mini-cart__buttons .checkout:hover,
.cart-sidebar .woocommerce-mini-cart__buttons .checkout:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

/* Secondary "View Cart" / "Vaata ostukorvi" button placed SECOND */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:not(.checkout),
.dropdown-cart .woocommerce-mini-cart__buttons a:not(.checkout),
.cart-sidebar .woocommerce-mini-cart__buttons a:not(.checkout) {
    order: 2 !important;
    display: block !important;
    width: 100% !important;
    background-color: transparent !important;
    color: #1a1a1a !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    text-align: center !important;
    padding: 10px 18px !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons a:not(.checkout):hover,
.dropdown-cart .woocommerce-mini-cart__buttons a:not(.checkout):hover,
.cart-sidebar .woocommerce-mini-cart__buttons a:not(.checkout):hover {
    background-color: #faf0ef !important;
    color: #1a1a1a !important;
    border-color: #1a1a1a !important;
}

/* 2. Checkout Form Clean SEIK Styling (Strictly No Rounded Corners) */
.woocommerce-checkout form.checkout input[type="text"],
.woocommerce-checkout form.checkout input[type="email"],
.woocommerce-checkout form.checkout input[type="tel"],
.woocommerce-checkout form.checkout input[type="password"],
.woocommerce-checkout form.checkout textarea,
.woocommerce-checkout form.checkout select,
.woocommerce-checkout .select2-container--default .select2-selection--single,
.woocommerce-checkout .select2-dropdown,
.woocommerce-checkout .woocommerce-input-wrapper input {
    border-radius: 0 !important;
    border: 1px solid #1a1a1a !important;
    box-shadow: none !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.woocommerce-checkout form.checkout input:focus,
.woocommerce-checkout form.checkout textarea:focus,
.woocommerce-checkout form.checkout select:focus {
    border-color: #1a1a1a !important;
    outline: 2px solid #1a1a1a !important;
    outline-offset: 1px !important;
}

/* Checkboxes and Radios */
.woocommerce-checkout input[type="checkbox"],
.woocommerce-checkout input[type="radio"] {
    border-radius: 0 !important;
    accent-color: #1a1a1a !important;
}

/* 3. Place Order Button */
#place_order,
.woocommerce-checkout #payment #place_order {
    display: block !important;
    width: 100% !important;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 16px 24px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

#place_order:hover,
.woocommerce-checkout #payment #place_order:hover {
    background-color: #333333 !important;
    color: #ffffff !important;
    border-color: #333333 !important;
}

/* 4. Checkout Order Review Table & Boxes */
.woocommerce-checkout #order_review,
.woocommerce-checkout #order_review_heading {
    border-radius: 0 !important;
}

.woocommerce-checkout table.shop_table {
    border-radius: 0 !important;
    border-collapse: collapse !important;
}

.woocommerce-checkout table.shop_table th,
.woocommerce-checkout table.shop_table td {
    border-radius: 0 !important;
}

/* Payment Methods Box */
.woocommerce-checkout #payment {
    background-color: #faf0ef !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 0 !important;
    padding: 18px 20px !important;
}

.woocommerce-checkout #payment ul.payment_methods {
    border-bottom: 1px solid #e2d7d2 !important;
    padding-bottom: 15px !important;
}

.woocommerce-checkout #payment div.payment_box {
    background-color: #ffffff !important;
    border: 1px solid #1a1a1a !important;
    border-radius: 0 !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
}

.woocommerce-checkout #payment div.payment_box::before {
    display: none !important;
}

/* 5. Invoice & Company Details (Hidden by default, revealed only under checkbox) */
#billing_company_field,
#billing_company_id_field,
#billing_vat_number_field,
#billing_eu_vat_number_field,
.seik-invoice-details-wrap {
    display: none;
}

#addCompDet {
    margin: 20px 0 15px 0 !important;
    padding: 0 !important;
}

#addCompDet .woocommerce-form__label-for-checkbox {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin-bottom: 0 !important;
}

#addCompDet .woocommerce-form__label-for-checkbox input[type="checkbox"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: #1a1a1a !important;
}

.seik-invoice-details-wrap {
    margin-top: 14px !important;
    padding: 16px 18px !important;
    background: #faf8f7 !important;
    border: 1px solid #1a1a1a !important;
    box-sizing: border-box !important;
    display: none;
}

.seik-invoice-details-wrap::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

.seik-invoice-details-wrap .form-row {
    margin-bottom: 12px !important;
}

.seik-invoice-details-wrap .form-row-first {
    width: 48% !important;
    float: left !important;
    clear: both !important;
}

.seik-invoice-details-wrap .form-row-last {
    width: 48% !important;
    float: right !important;
}

@media (max-width: 600px) {
    .seik-invoice-details-wrap .form-row-first,
    .seik-invoice-details-wrap .form-row-last {
        width: 100% !important;
        float: none !important;
    }
}

.seik-invoice-details-wrap .form-row:last-child {
    margin-bottom: 0 !important;
}

.seik-invoice-details-wrap label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin-bottom: 5px !important;
}

/* Ensure VAT field is visible when invoice details wrap is active */
.seik-invoice-details-wrap #billing_vat_number_field,
.seik-invoice-details-wrap #billing_vat_number_field.seikVatHidden,
.seik-invoice-details-wrap #billing_eu_vat_number_field,
.seik-invoice-details-wrap #billing_eu_vat_number_field.seikVatHidden {
    display: block !important;
}
