/**
 * dir assets/css/
 * file woo-checkout.css
 * GUSTABE MASTER CHECKOUT STYLES
 * Update: Cleaned, De-duplicated (ใช้ Component กองกลางสำหรับหน้าบิลแล้ว)
 */

/* =========================================
   1. SHARED COMPONENTS (เฉพาะ Timeline)
   ========================================= */

/* Style the default page header to look like a Premium OEM Lab theme instead of hiding it */
.woocommerce-cart .page-header,
.woocommerce-checkout .page-header {
    text-align: center;
    padding: 30px 0 10px;
    margin-bottom: 20px;
}

.woocommerce-cart .page-header h1.entry-title,
.woocommerce-checkout .page-header h1.entry-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

.checkout-timeline {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.checkout-timeline .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #ccc;
    position: relative;
    z-index: 2;
}

.checkout-timeline .step.active,
.checkout-timeline .step.completed {
    color: var(--primary-color);
}

.checkout-timeline .icon {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #eee;
    transition: 0.3s;
}

.checkout-timeline .step.active .icon,
.checkout-timeline .step.completed .icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(4, 163, 156, 0.3);
}

.checkout-timeline .step.completed span {
    font-weight: 700;
}

.checkout-timeline .line {
    flex: 1;
    height: 2px;
    background: #eee;
    margin: -20px 10px 0;
    max-width: 100px;
}

.checkout-timeline .line.active {
    background: var(--primary-color);
}


/* =========================================
   2. CART PAGE STYLES (หน้าตะกร้าสินค้า)
   ========================================= */
.gustabe-cart-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 50px;
    display: grid;
    gap: 1em;
}

.reward-progress-container {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #eee;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.reward-bar-bg {
    height: 8px;
    background: #eee;
    border-radius: 10px;
    position: relative;
    margin: 30px 10px 10px;
}

.reward-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00d2c6);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.tier-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.tier-point .dot {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    transition: 0.3s;
}

.tier-point.passed .dot {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.tier-point .label {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 11px;
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
}

.tier-point:hover .label,
.tier-point.passed .label {
    opacity: 1;
    bottom: 30px;
}

.tier-point .amount {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #999;
}

.reward-message {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #555;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 8px;
}

.reward-message i {
    color: #f57f17;
    margin-right: 5px;
    vertical-align: middle;
}

.gustabe-cart-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.item-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
}

.item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    max-width: 85%;
}

.item-name a {
    color: #333;
    text-decoration: none;
}

.remove-item {
    color: #ff4d4f;
    opacity: 0.7;
    transition: 0.2s;
}

.remove-item:hover {
    opacity: 1;
    transform: scale(1.1);
}

.item-price-unit {
    font-size: 13px;
    color: #888;
}

.item-subtotal {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 50px;
    padding: 2px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.qty-stepper input.qty {
    width: 40px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    height: 28px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-stepper input.qty::-webkit-outer-spin-button,
.qty-stepper input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}


/* =========================================
   1. SHARED COMPONENTS (เฉพาะ Timeline)
   ========================================= */
.checkout-timeline {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.checkout-timeline .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #ccc;
    position: relative;
    z-index: 2;
}

.checkout-timeline .step.active,
.checkout-timeline .step.completed {
    color: var(--primary-color);
}

.checkout-timeline .icon {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #eee;
    transition: 0.3s;
}

.checkout-timeline .step.active .icon,
.checkout-timeline .step.completed .icon {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(4, 163, 156, 0.3);
}

.checkout-timeline .step.completed span {
    font-weight: 700;
}

.checkout-timeline .line {
    flex: 1;
    height: 2px;
    background: #eee;
    margin: -20px 10px 0;
    max-width: 100px;
}

.checkout-timeline .line.active {
    background: var(--primary-color);
}

/* =========================================
   3. CHECKOUT PAGE STYLES (หน้าชำระเงิน)
   ========================================= */


.woocommerce form .form-row {
    margin-bottom: 15px;
}

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

.woocommerce form .form-row input.input-text,
.select2-container .select2-selection--single {
    height: 48px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 0 15px;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    transition: 0.2s;
}

.woocommerce form .form-row textarea {
    min-height: 120px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    padding: 15px;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    transition: 0.2s;
    resize: vertical;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(4, 163, 156, 0.1);
    outline: none;
}

/* Fix Select2 Vertical Alignment & Style to match input */
.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 46px;
    padding-left: 0;
    color: #333;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 10px;
}

.select2-container--default .select2-selection--single {
    outline: none;
}

.select2-container--open .select2-selection--single {
    border-color: var(--primary-color) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(4, 163, 156, 0.1);
}

/* Grid Layout for Checkout Forms */
.gustabe-form-grid {
    display: flex;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 15px;
}

.gustabe-form-grid .form-row {
    width: 100%;
    margin-bottom: 0;
}

.gustabe-form-grid .form-row-first,
.gustabe-form-grid .form-row-last {
    width: calc(50% - 10px);
}

@media (max-width: 767px) {

    .gustabe-form-grid .form-row-first,
    .gustabe-form-grid .form-row-last {
        width: 100%;
    }
}

/* =========================================
   4. THANK YOU PAGE (Order Received)
   ========================================= */
.gustabe-order-received-app {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.gustabe-card.success-card,
.gustabe-card.error-card {
    text-align: center;
    padding: 40px 30px;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.status-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: popUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-icon.success {
    color: var(--primary-color);
}

.status-icon.error {
    color: #ff4d4f;
}

.success-card h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.success-card p {
    color: #666;
    margin-bottom: 30px;
}

.order-meta-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    padding: 20px;
    margin: 0;
    background: #f9f9f9;
    border-radius: 12px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px;
    border-right: 1px solid #eee;
}

.meta-item:last-child {
    border-right: none;
}

.meta-item span {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item strong {
    font-size: 16px;
    color: #333;
    margin-top: 5px;
}

.meta-item strong.price {
    color: var(--primary-color);
}