/**
 * Gift Card Redemption Styling for Cart Page
 * Ensures "Have a gift card?" field matches cart styling
 * Version: 1.0.0
 */

/* ==========================================
   GIFT CARD REDEMPTION CONTAINER
   ========================================== */

#pwgc-redeem-gift-card-form,
#pwgc-redeem-gift-card-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ==========================================
   LABEL STYLING
   ========================================== */

label[for="pwgc-redeem-gift-card-number"] {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-family: inherit;
}

/* ==========================================
   INPUT FIELD STYLING
   ========================================== */

#pwgc-redeem-gift-card-number,
input#pwgc-redeem-gift-card-number {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    margin-right: 10px;
    margin-bottom: 10px;
    font-family: inherit;
    transition: all 0.3s ease;
}

#pwgc-redeem-gift-card-number:focus,
input#pwgc-redeem-gift-card-number:focus {
    outline: none;
    border-color: #8b6f47;
    box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.1);
}

#pwgc-redeem-gift-card-number::placeholder,
input#pwgc-redeem-gift-card-number::placeholder {
    color: #999;
    opacity: 1;
}

/* ==========================================
   BUTTON STYLING
   ========================================== */

#pwgc-redeem-button,
#pwgc-apply-gift-card,
input#pwgc-redeem-button,
input#pwgc-apply-gift-card {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #8b6f47;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    vertical-align: top;
}

#pwgc-redeem-button:hover,
#pwgc-apply-gift-card:hover,
input#pwgc-redeem-button:hover,
input#pwgc-apply-gift-card:hover {
    background: #6b5437;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#pwgc-redeem-button:active,
#pwgc-apply-gift-card:active,
input#pwgc-redeem-button:active,
input#pwgc-apply-gift-card:active {
    transform: translateY(0);
}

/* ==========================================
   ERROR MESSAGES
   ========================================== */

#pwgc-redeem-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fadbd8;
    border-left: 3px solid #e74c3c;
    border-radius: 3px;
    display: none;
}

#pwgc-redeem-error:not(:empty) {
    display: block;
}

/* ==========================================
   AFTER CART CONTENTS LAYOUT (TABLE ROW)
   ========================================== */

tr td.actions .coupon {
    margin-bottom: 0;
}

tr td.actions .coupon label[for="pwgc-redeem-gift-card-number"] {
    margin-right: 10px;
    margin-bottom: 8px;
}

tr td.actions .coupon #pwgc-redeem-gift-card-number {
    display: inline-block;
    width: auto;
    min-width: 250px;
    vertical-align: middle;
}

tr td.actions .coupon #pwgc-apply-gift-card {
    vertical-align: middle;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    #pwgc-redeem-gift-card-number,
    input#pwgc-redeem-gift-card-number {
        width: 100%;
        max-width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }

    #pwgc-redeem-button,
    #pwgc-apply-gift-card,
    input#pwgc-redeem-button,
    input#pwgc-apply-gift-card {
        width: 100%;
        display: block;
    }

    tr td.actions .coupon #pwgc-redeem-gift-card-number {
        width: 100%;
        min-width: auto;
        display: block;
        margin-bottom: 12px;
    }

    tr td.actions .coupon #pwgc-apply-gift-card {
        width: 100%;
        display: block;
    }
}

@media (max-width: 480px) {
    #pwgc-redeem-gift-card-form,
    #pwgc-redeem-gift-card-container {
        padding: 16px;
        margin: 16px 0;
    }

    label[for="pwgc-redeem-gift-card-number"] {
        font-size: 15px;
    }

    #pwgc-redeem-gift-card-number,
    input#pwgc-redeem-gift-card-number {
        font-size: 15px;
        padding: 10px 14px;
    }

    #pwgc-redeem-button,
    #pwgc-apply-gift-card,
    input#pwgc-redeem-button,
    input#pwgc-apply-gift-card {
        font-size: 15px;
        padding: 10px 20px;
    }
}
