/* ==========================================================================
   OhMyBread Cart Coupon Form Styling (COUPONFIX)
   Loaded conditionally on cart page only (enqueued in functions.php)
   Scoped to .wc-block-cart to avoid affecting checkout or mini-cart
   ========================================================================== */

/* --- Coupon Panel Toggle --- */
.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button {
    font-weight: 600;
    color: var(--omb-navy, #2C3E50);
}

.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button:hover {
    color: var(--omb-coral, #FF6B6B);
}

.wc-block-cart .wc-block-components-totals-coupon .wc-block-components-panel__button-icon {
    fill: var(--omb-coral, #FF6B6B);
}

/* --- Coupon Input Field --- */
.wc-block-cart .wc-block-components-totals-coupon__input input[type="text"] {
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    height: 48px !important;
    padding: 12px 16px !important;
    font-size: 15px;
    background-color: #fff !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wc-block-cart .wc-block-components-totals-coupon__input input[type="text"]:focus {
    border-color: var(--omb-coral, #FF6B6B) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15) !important;
    outline: none;
}

/* Adjust floating label position for rounded input */
.wc-block-cart .wc-block-components-totals-coupon__input label {
    left: 16px;
    color: #999;
}

.wc-block-cart .wc-block-components-totals-coupon__input.is-active label {
    color: var(--omb-coral, #FF6B6B);
}

/* --- Apply Coupon Button --- */
/* Reset the outer button container */
.wc-block-cart .wc-block-components-totals-coupon__button {
    background: var(--omb-coral, #FF6B6B) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.wc-block-cart .wc-block-components-totals-coupon__button:hover {
    background: var(--omb-navy, #2C3E50) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.wc-block-cart .wc-block-components-totals-coupon__button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.2);
}

/* Override the global .wc-block-components-button__text pill style for this button */
.wc-block-cart .wc-block-components-totals-coupon__button .wc-block-components-button__text {
    background: none !important;
    padding: 0 24px !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    font-weight: 600;
    box-shadow: none !important;
    color: white !important;
    line-height: 48px;
}

.wc-block-cart .wc-block-components-totals-coupon__button:hover .wc-block-components-button__text {
    transform: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* --- Form Layout Fine-tuning --- */
.wc-block-cart .wc-block-components-totals-coupon__form {
    gap: 10px;
    align-items: stretch;
}

/* --- Coupon Applied: Discount Badge --- */
.wc-block-cart .wc-block-components-totals-discount .wc-block-components-totals-item__value {
    color: #2c662d;
    font-weight: 600;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .wc-block-cart .wc-block-components-totals-coupon__form {
        flex-direction: column;
        gap: 8px;
    }

    .wc-block-cart .wc-block-components-totals-coupon__input {
        flex: 1 1 100% !important;
    }

    .wc-block-cart .wc-block-components-totals-coupon__button {
        flex: 1 1 100% !important;
        width: 100%;
    }

    .wc-block-cart .wc-block-components-totals-coupon__button .wc-block-components-button__text {
        padding: 0 !important;
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wc-block-cart .wc-block-components-totals-coupon__input input[type="text"] {
        font-size: 16px;  /* Prevents iOS zoom on focus */
    }
}
