/* Reset all Magento default styles for custom checkout */
#custom-api-checkout {
    all: unset;
    display: block;
}

#custom-api-checkout * {
    all: unset;
    display: revert;
}

/* Custom Checkout Styles - 1:1 from chekout.html */
#custom-api-checkout {
    --primary-text: #1c1c1c;
    --secondary-text: #666;
    --border-color: #eee;
    --green-bg: #d4f7e6;
    --green-text: #1f8b57;
    --dark-btn: #232f3e;
    --bg-color: #f8f8f8;
}

#custom-api-checkout * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
}

#custom-api-checkout {
    background-color: var(--bg-color);
    color: var(--primary-text);
    padding: 40px;
}

/* Container */
#custom-api-checkout .custom-checkout-container {
    max-width: 1400px;
    margin: 0 auto;
}

#custom-api-checkout h1.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #222;
}

/* Layout Grid */
#custom-api-checkout .cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* --- Left Column --- */

/* Green Banner */
#custom-api-checkout .promo-banner {
    background-color: var(--green-bg);
    color: var(--green-text);
    padding: 15px 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
    font-weight: 500;
}

#custom-api-checkout .coupon-badge {
    border: 1px dashed var(--green-text);
    padding: 5px 15px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Cart Table Headers */
#custom-api-checkout .cart-header {
    display: grid;
    grid-template-columns: 4fr 1fr 1.5fr 1fr;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Product Row */
#custom-api-checkout .cart-item {
    display: grid;
    grid-template-columns: 4fr 1fr 1.5fr 1fr;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

#custom-api-checkout .product-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

#custom-api-checkout .remove-icon {
    color: #ff4d4f;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
}

#custom-api-checkout .product-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

#custom-api-checkout .product-name {
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

#custom-api-checkout .price,
#custom-api-checkout .subtotal {
    font-weight: 500;
    color: #333;
}

/* Quantity Selector */
#custom-api-checkout .qty-selector {
    display: inline-flex;
    background-color: #eee;
    padding: 8px 15px;
    border-radius: 2px;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

#custom-api-checkout .qty-btn {
    cursor: pointer;
    user-select: none;
}

/* Coupon & Update Actions */
#custom-api-checkout .cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

#custom-api-checkout .coupon-input-group {
    display: flex;
    gap: 10px;
}

#custom-api-checkout .coupon-input-group input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    outline: none;
}

#custom-api-checkout .coupon-input-group button {
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
}

#custom-api-checkout .coupon-input-group button:hover {
    background-color: #555;
}

#custom-api-checkout .update-cart-link {
    color: #333;
    text-decoration: underline;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}

/* Trust Badges (The 3 boxes at bottom left) */
#custom-api-checkout .trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

#custom-api-checkout .trust-item {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

#custom-api-checkout .trust-icon {
    font-size: 24px;
    margin-bottom: 15px;
    color: #4a5568;
}

#custom-api-checkout .trust-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
}

#custom-api-checkout .trust-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}

/* --- Right Column (Totals) --- */
#custom-api-checkout .cart-totals {
    background: white;
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

#custom-api-checkout .totals-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

#custom-api-checkout .total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
}

#custom-api-checkout .shipping-section {
    margin-bottom: 20px;
}

#custom-api-checkout .shipping-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 15px;
}

#custom-api-checkout .shipping-option {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
    align-items: center;
}

#custom-api-checkout .shipping-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

#custom-api-checkout .shipping-option input[type="radio"] {
    cursor: pointer;
}

#custom-api-checkout .shipping-destination {
    margin-top: 20px;
    font-size: 13px;
    color: #333;
}

#custom-api-checkout .change-address {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #555;
    text-decoration: underline;
    margin-top: 5px;
    cursor: pointer;
}

#custom-api-checkout .final-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-bottom: 20px;
}

#custom-api-checkout .checkout-btn {
    width: 100%;
    background-color: var(--dark-btn);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 30px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    margin-bottom: 20px;
}

#custom-api-checkout .checkout-btn:hover {
    background-color: #3a4a5e;
}

#custom-api-checkout .secure-text {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

#custom-api-checkout .payment-icons {
    display: flex;
    justify-content: center;
    gap: 5px;
}

#custom-api-checkout .payment-icons img {
    height: 20px;
}

/* Utilities */
#custom-api-checkout .text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    #custom-api-checkout .cart-layout {
        grid-template-columns: 1fr;
    }

    #custom-api-checkout .cart-header,
    #custom-api-checkout .cart-item {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}
