/* Simplified Checkout Styles - 2 Column Layout with Unified Form */

/* Hide page title */
.checkout .entry-header {
    display: none !important;
}

.woocommerce-checkout article.page{
    background: unset !important;
    padding: 0 !important;
    margin-top: 80px;
}

.woocommerce-checkout article.page h1.entry-title{
    font-family: Vintage, Museo Sans !important;
    font-size: 48px !important;
    text-align: center;
}

/* Main checkout form - encompasses everything */
.checkout.woocommerce-checkout {
    background-color: unset !important;
    min-height: 100vh !important;
    padding: 20px !important;
    border-radius: 20px;
}

/* Main checkout container - 2 columns */
.checkout-container {
    display: grid !important;
    grid-template-columns: 1fr 400px !important;
    gap: 40px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Left Column - Steps and Forms */
.checkout-left-column {
    background-color: transparent !important;
}

/* Step Navigation - Desktop Only - Updated Styles */
.step-navigation-desktop {
    display: flex !important;
    gap: 10px !important;
    margin-bottom: 30px !important;
}

.step-btn {
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    color: var(--bsr-text-secondary, #12263A) !important;
    cursor: pointer !important;
    padding: 10px 5px !important;
    position: relative !important;
    transition: color 0.3s ease !important;
    font-family: var(--bsr-font-primary, inherit) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.step-btn.active .step-title{
    color: #06BCC1 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 10px !important;
}

.step-btn.completed {
    color: #06BCC1 !important;
}

.step-btn:hover {
    color: #06BCC1 !important;
}

.step-btn.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.step-number {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    background-color: #ccc !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.step-btn.active .step-number,
.step-btn.completed .step-number {
    background-color: #06BCC1 !important;
}

.step-title {
    font-size: 18px !important;
}

/* Step Content Areas */
.checkout-step-content {
    margin-bottom: 30px !important;
    transition: opacity 0.3s ease !important;
}

/* Desktop: Hide inactive steps */
@media (min-width: 769px) {
    .checkout-step-content {
        display: none !important;
    }
    
    .checkout-step-content.active {
        display: block !important;
    }
}

.step-heading {
    color: #333 !important;
    font-size: 24px !important;
    margin-bottom: 25px !important;
    font-weight: 600 !important;
}

/* Form Styling */
.woocommerce-checkout .form-row {
    margin-bottom: 20px !important;
}

.woocommerce-checkout .form-row label {
    display: block !important;
    margin-bottom: 8px !important;
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100% !important;
    padding: 12px 15px !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #F2F2F2 !important;
    font-size: 14px !important;
    color: #333 !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
    outline: none !important;
    background-color: white !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1) !important;
}

/* Form layout */
.col2-set {
    display: flex !important;
    width: 100% !important;
    margin: 0px !important;
}

.col2-set .col-1,
.col2-set .col-2 {
    flex: 1 !important;
}

/* Express Payment Section */
.express-payment-section {
    margin-bottom: 20px !important;
}

#wc-stripe-express-checkout-element {
    margin-bottom: 15px !important;
}

#wc-stripe-express-checkout-element .StripeElement {
    margin-bottom: 10px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* Hide ALEBO separators */
.payment-separator,
#wc-stripe-express-checkout-button-separator {
    display: none !important;
}

/* Standard Payment Methods - Button Style */
.standard-payment-section {
    margin-top: 20px !important;
}

.wc_payment_methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.wc_payment_methods li {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    cursor: default !important;
    transition: none !important;
}

.wc_payment_methods li:hover {
    background: transparent !important;
}

.wc_payment_methods li.wc_payment_method input[type="radio"] {
    display: none !important;
}

.wc_payment_methods li.wc_payment_method label {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 15px 20px !important;
    background-color: #F2F2F2 !important;
    border: 2px solid transparent !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    color: #333 !important;
    min-height: 50px !important;
}

.wc_payment_methods li.wc_payment_method label:hover {
    background-color: #e8e8e8 !important;
}

.wc_payment_methods li.wc_payment_method input[type="radio"]:checked + label {
    background-color: #333 !important;
    color: white !important;
    border-color: #333 !important;
}

/* Payment Method Icons */
.wc_payment_methods li.wc_payment_method label::before {
    content: '' !important;
    width: 24px !important;
    height: 24px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    transition: all 0.3s ease !important;
}

/* Bank Transfer Icon - Updated with horizontal arrows */
.payment_method_bacs label::before {
  content: "";
  display: inline-block;
  width: 1.25em;          /* tweak size as needed */
  height: 1em;
  margin-right: .4em;

  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20800%20600%27%3E%3Cpath%20d%3D%27M290.667%2C221.771l0%2C103.579l-159.351%2C-159.352l159.351%2C-159.351l0%2C103.578l378.017%2C0l0%2C111.546l-378.017%2C0Z%27%2F%3E%3Cpath%20d%3D%27M509.333%2C378.229l-0%2C-103.579l159.351%2C159.352l-159.351%2C159.351l-0%2C-103.578l-378.017%2C-0l-0%2C-111.546l378.017%2C-0Z%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}


/* Update icons to white when selected */
.wc_payment_methods li.wc_payment_method input[type="radio"]:checked + label::before {
    filter: brightness(0) invert(1) !important;
}

/* Cash on Delivery Icon */
.payment_method_cod label::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>') !important;
}

/* Credit Card Icon */
.payment_method_stripe label::before,
.payment_method_card label::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg>') !important;
}

/* Payment Method Descriptions - Updated styles */
.payment-methods-descriptions {
    background-color: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-top: 20px !important;
}
.payment_box::before{
    display:none !important;
}
.payment_box {
    background: transparent !important;
    border: none !important;
    padding: 15px 0 !important;
    margin: 15px 0 0 0 !important;
    color: #333 !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.payment_box p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px !important;
    font-weight: 500;
    text-align: center !important;
}

/* Step Actions */
.step-actions {
    display: flex !important;
    gap: 15px !important;
    margin-top: 30px !important;
    justify-content: flex-end !important;
}

.btn-continue,
.btn-back {
    padding: 12px 25px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.btn-continue {
    background-color: #333 !important;
    color: white !important;
}

.btn-back {
    background-color: #F2F2F2 !important;
    color: #333 !important;
}

.btn-continue:hover {
    background-color: #555 !important;
}

.btn-back:hover {
    background-color: #e0e0e0 !important;
}

.btn-continue.disabled,
.btn-continue:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
}

/* Right Column - Order Summary */
.checkout-right-column {
    position: sticky !important;
    top: 20px !important;
    height: fit-content !important;
}

.order-summary-box {
    background-color: #D1C3C3 !important;
    border-radius: 20px !important;
    padding: 25px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
}

.order-summary-box h3 {
    text-align: center !important;
    margin-bottom: 20px !important;
    font-size: 20px !important;
    color: #333 !important;
    font-weight: 600 !important;
}

/* Order Review Container - Full Width */
#order_review {
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
}

/* Order Review - Product List */
.order-summary-box .shop_table {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.order-summary-box .shop_table thead {
    display: none !important;
}

.order-summary-box .shop_table tbody {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    border-bottom: solid 4px #12263A;
    padding: 0 !important;
}

.order-summary-box .cart_item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    padding: 12px 0 !important;
    border: none !important;
    margin: 0 !important;
    background: transparent !important;
    width: 100% !important;
}

.order-summary-box .cart_item:last-of-type {
    border: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 12px !important;
}

/* Fixed product name truncation to preserve quantity */
.order-summary-box .cart_item .product-name {
    flex: 1 !important;
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
    line-height: 1.3 !important;
    width: auto !important;
    border: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 5px !important;
}

/* Ensure quantity is always visible */
.order-summary-box .cart_item .product-name .product-quantity {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    order: 2 !important;
}

/* Truncate only the product title part */
.order-summary-box .cart_item .product-name > *:not(.product-quantity) {
    flex: 1 !important;
    order: 1 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 2.6em !important;
}

.order-summary-box .cart_item .product-total {
    color: #333 !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    border: none !important;
}

/* HR Separator */
.order-summary-box hr.order-summary-separator {
    width: 100% !important;
    border: none !important;
    border-top: 2px solid #333 !important;
    margin: 15px 0 !important;
    padding: 0 !important;
}

/* Pricing Summary Section - Remove All Borders */
.order-summary-box .shop_table tfoot {
    display: block !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.order-summary-box .shop_table tfoot tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    width: 100% !important;
}

.order-summary-box .shop_table tfoot th,
.order-summary-box .shop_table tfoot td {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    width: auto !important;
}

/* Order Total Row - Updated font size and weight */
.order-summary-box .order-total th,
.order-summary-box .order-total td {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #333 !important;
    border: none !important;
    background: transparent !important;
}

/* Remove any gray backgrounds or borders from shipping methods */
.order-summary-box .woocommerce-shipping-methods {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.order-summary-box .woocommerce-shipping-methods li {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.order-summary-box .woocommerce-shipping-methods label {
    background: transparent !important;
    border: none !important;
    color: #333 !important;
    /* Hide label text, keep only the price visible */
    font-size: 0px !important;
    font-weight: 500 !important;
}
.woocommerce .woocommerce-shipping-methods label .woocommerce-Price-amount { font-size: 14px !important; }


/* Place Order Section - Below Order Summary */
.place-order-section {
    margin-top: 20px !important;
    padding-top: 20px !important;
}

/* Terms and Conditions - Below Order Summary */
.woocommerce-terms-and-conditions-wrapper {
    margin: 0 0 15px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.woocommerce-terms-and-conditions-wrapper .checkbox {
    margin: 0 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    transition: all 0.3s ease !important;
}

.woocommerce-terms-and-conditions-wrapper .checkbox input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    transition: border-color 0.3s ease !important;
}

.woocommerce-terms-and-conditions-wrapper .checkbox label {
    font-size: 13px !important;
    color: #333 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    transition: color 0.3s ease !important;
}

.woocommerce-terms-and-conditions-wrapper .checkbox label a {
    color: #06BCC1 !important;
    text-decoration: underline !important;
}

/* Error state for terms - Updated with pulse animation */
.woocommerce-terms-and-conditions-wrapper.terms-error .checkbox {
    animation: pulse 0.6s ease-in-out infinite alternate !important;
}

.woocommerce-terms-and-conditions-wrapper.terms-error .checkbox input[type="checkbox"] {
    border: 2px solid #ff4444 !important;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.2) !important;
}

.woocommerce-terms-and-conditions-wrapper.terms-error .checkbox label {
    color: #ff4444 !important;
}

/* Privacy policy text error state */
.woocommerce-terms-and-conditions-wrapper.terms-error .woocommerce-privacy-policy-text {
    color: #ff4444 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#place_order:hover {
    background-color: #e0e0e0 !important;
    transform: translateY(-2px) !important;
}

#place_order:disabled,
#place_order.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background-color: #ccc !important;
}

#place_order.loading {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Select2 Styling */
.select2-container--default .select2-selection--single {
    background-color: #F2F2F2 !important;
    border: none !important;
    border-radius: 8px !important;
    height: 45px !important;
    line-height: 45px !important;
}

/* Checkboxes */
.woocommerce-checkout .checkbox {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 15px 0 !important;
}

.woocommerce-checkout .checkbox input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
}

/* Place Order Button */
#place_order {
    width: 100% !important;
    background-color: #F2F2F2 !important;
    color: #333 !important;
    border: none !important;
    border-radius: 15px !important;
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 5px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

#place_order:hover {
    background-color: #e0e0e0 !important;
    transform: translateY(-2px) !important;
}

#place_order:disabled,
#place_order.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background-color: #ccc !important;
    pointer-events: none !important;
}

#place_order.loading {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Fallback for empty button text */
#place_order:empty::before,
#place_order.button-fallback-text::before {
    content: "Objednať" !important;
    display: block !important;
}

/* Force button text to show */
#place_order[value=""]::after {
    content: "Objednať" !important;
    display: block !important;
}

.woocommerce-terms-and-conditions-wrapper .checkbox {
    margin: 10px 0 !important;
}

/* Utility Classes */
.desktop-only {
    display: block !important;
}

.mobile-only {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Change to single column on mobile */
    .checkout-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .checkout.woocommerce-checkout {
        padding: 15px !important;
    }
    
    /* Hide desktop step navigation */
    .step-navigation-desktop {
        display: none !important;
    }
    
    /* Show all steps on mobile */
    .checkout-step-content {
        display: block !important;
        margin-bottom: 30px !important;
        padding-bottom: 30px !important;
        border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    }
    
    .checkout-step-content:last-child {
        border-bottom: none !important;
    }
    
    /* Hide step actions on mobile */
    .step-actions {
        display: none !important;
    }
    
    /* Left column becomes top section */
    .checkout-left-column {
        order: 1 !important;
    }
    
    /* Right column becomes bottom section */
    .checkout-right-column {
        order: 2 !important;
        position: static !important;
    }
    
    /* Adjust form layout for mobile */
    .col2-set {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .order-summary-box {
        margin-top: 20px !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* Loading states */
.checkout-step-content.loading {
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.btn-continue.loading,
.btn-back.loading {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

/* Error states */
.field-error input,
.field-error select {
    border: 1px solid #ff4444 !important;
    background-color: #fff5f5 !important;
}

.field-error-message {
    color: #ff4444 !important;
    font-size: 12px !important;
    margin-top: 5px !important;
    display: block !important;
}

/* Product Name Truncation Fix for Order Summary */

/* Ensure product names always show quantity and properly truncate only the title */
.order-summary-box .cart_item .product-name {
    flex: 1 !important;
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    margin: 0 !important;
    padding: 0 15px 0 0 !important;
    line-height: 1.3 !important;
    width: auto !important;
    border: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 5px !important;
}

/* Style for the product title part (everything except quantity) */
.order-summary-box .cart_item .product-name > *:not(.product-quantity):not(strong) {
    flex: 1 !important;
    min-width: 0 !important; /* Important for text truncation */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 2.6em !important;
    order: 1 !important;
}

/* Style for the quantity part - always visible */
.order-summary-box .cart_item .product-name .product-quantity,
.order-summary-box .cart_item .product-name strong {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    order: 2 !important;
    font-weight: 600 !important;
    margin-left: auto !important;
}

/* Alternative approach: Use JavaScript-friendly classes */
.product-title-part {
    flex: 1 !important;
    min-width: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 2.6em !important;
}

.product-quantity-part {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    margin-left: 8px !important;
}

/* Coupon Toggle Styling */
.woocommerce-form-coupon-toggle {
    margin-bottom: 25px !important;
}

.woocommerce-form-coupon-toggle .woocommerce-info::before{
    display:none !important;
}

.woocommerce-form-coupon-toggle .woocommerce-info {
    background-color: unset !important;
    border: none !important;
    padding: 20px 25px !important;
    margin: 0 !important;
    margin-top: -30px !important;
    color: #333 !important;
    font-size: 18px !important;
    transition: all 0.3s ease !important;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-content: center;
    text-align: center;
}

.woocommerce-form-coupon-toggle .showcoupon {
    color: #06BCC1 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    padding: 8px 15px !important;
    background-color: #F2F2F2  !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    margin-top: 10px;
}

.woocommerce-form-coupon-toggle .showcoupon:hover {
    background-color: #06BCC1 !important;
    color: white !important;
    text-decoration: none !important;
}

/* Coupon Form */
.checkout_coupon {
    background-color: #F2F2F2 !important;
    border: none !important;
    border-radius: 15px !important;
    padding: 25px !important;
    margin: 15px auto 25px auto !important;
}

.checkout_coupon input[type="text"] {
    width: 100% !important;
    padding: 12px 15px !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: white !important;
    font-size: 14px !important;
    color: #333 !important;
}

.checkout_coupon button {
    width: 100% !important;
    padding: 12px 20px !important;
    background-color: #06BCC1 !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.checkout_coupon button:hover {
    background-color: #059ca1 !important;
}