/* Main Container */
body{
    font-family: Termina !important;
}

.gift-voucher-container {
    margin: auto !important;
    font-family: Termina;
    background-color: #ffffff !important;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    border-radius: 10px;
}

.gift-voucher-form {
    border-radius: 12px;
    width: 100%;
    background-color: #ffffff;
}

/* Two Column Layout */
.voucher-main-container {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 60px;
    align-items: start;
    min-height: 500px;
    padding: 10px;
}

/* Left Column - Voucher Image */
.voucher-image-column {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voucher-image-column img {
    max-width: 100%;
    width: 728px;
    height: auto;
    aspect-ratio: 728/509;
    display: block;
}

/* Right Column - Controls */
.voucher-controls-column {
    padding-left: 20px;
    display: flex;
    padding-right: 20px !important;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #ffffff;
}

/* Product Header */
.product-header {
    margin-bottom: 30px;
}

.product-header h2 {
    color: #5A6135;
    font-family: Termina;
    font-size: 20px;
    font-style: normal;
    font-weight: 400;
    line-height: 32px;
}

.price-range {
    font-size: 30px;
    color: #5A6135; /* Dark olive green */
    font-weight: 400;
    font-family: Termina;
    line-height:30px;
}

/* Voucher Type Selection (Hidden but functional) */
.voucher-type-selection {
    display: none;
}

/* Voucher Step */
.voucher-step {
    margin-bottom: 30px;
    width: 100%;
}

.value-label {
    display: block;
    color: #5A6135;
    font-family: Termina;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

/* Amount Selection */
.amount-selection {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* FIXED */
    gap: 12px;
    margin-bottom: 20px;
}


.amount-btn {
    padding: 10px;
    background: transparent;
    border: 0.5px solid #5A6135;
    border-radius: 55px;
    cursor: pointer;
    font-family: Termina;
    font-size: 14px;
    font-weight: 400;
    font-style: normal;
    line-height: normal;
    color: #2d5016;
    transition: all 0.3s ease;
    text-align: center;
    width: 71px;
    height: 35px;
    
}

.amount-btn:hover,
.amount-btn.hover {
    border-color: #5A6135;
    background-color: rgba(90, 97, 53, 0.1);
}

.amount-btn.selected {
    background: #5A6135;
    color: #FFF;
    border-color: #5A6135;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 144px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 46px;
    background: #5A6135;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    letter-spacing: 1px;
    font-family: Termina;
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #7a8860; /* Darker olive green */
    transform: translateY(-2px);
}

.add-to-cart-btn:disabled,
.add-to-cart-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    color: #999;
}

/* User Fields */
.voucher-user-fields {
    margin-top: 20px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.voucher-field {
    margin-bottom: 20px;
}

.voucher-field label {
    display: block;
    color: #5A6135;
    font-family: Termina;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
}

.voucher-field input[type="text"],
.voucher-field input[type="email"],
.voucher-field input[type="datetime-local"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Termina;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.voucher-field input[type="text"]:focus,
.voucher-field input[type="email"]:focus,
.voucher-field input[type="datetime-local"]:focus {
    outline: none;
    border-color: #5A6135;
}

.voucher-field textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Termina;
    font-size: 14px;
    color: #333;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.voucher-field textarea:focus {
    outline: none;
    border-color: #5A6135;
}

.voucher-field .char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Delivery Info */
.delivery-info {
    margin-top: 10px;
}

.delivery-item {
    color: #5A6135;
    font-family: Termina;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin-top: 12px;
}

.delivery-separator {
    width: 100%;
    max-width: 621px;
    height: 1px;
    background-color: #ddd;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .voucher-main-container {
        gap: 40px;
        min-height: 450px;
    }
    
    .voucher-controls-column {
        padding-left: 10px;
    }
    
    .voucher-image-column img {
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    /* Mobile: avoid huge vertical whitespace (desktop uses flex centering) */
    .gift-voucher-container {
        height: auto;
        min-height: 0;
        display: block;
        align-items: stretch;
    }

    .gift-voucher-container {
        padding: 10px;
    }
    
    .gift-voucher-form {
        padding: 20px;
    }
    
    .product-header h2 {
        font-size: 12px;
        line-height: 20px;
    }

    .price-range {
        font-size: 20px;
        line-height: 1.2;
    }
    
    /* Stack columns on mobile */
    .voucher-main-container {
        /* Switch grid -> flex so we can reorder sections for better UX */
        display: flex;
        flex-direction: column-reverse; /* controls first, image after */
        gap: 20px;
        min-height: auto;
    }
    
    .voucher-controls-column {
        padding-left: 0;
        padding-right: 0 !important;
        justify-content: flex-start;
    }
    
    .voucher-image-column {
        margin-top: 10px;
        margin-bottom: 0;
    }
    
    .voucher-image-column img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    .amount-selection {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 10px;
    }
    
    .amount-btn {
        font-size: 12px;
        padding: 10px 12px;
        width: 100%;
    }

    .add-to-cart-btn {
        width: 100%;
        max-width: 325px;
        align-self: center;
    }

    .delivery-separator {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .voucher-image-column img {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .amount-selection {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .amount-btn {
        font-size: 12px;
        padding: 8px 10px;
        width: 100%;
    }

    .voucher-controls-column {
        padding-right: 0 !important;
    }
}

/* Loading State */
.add-to-cart-btn.loading {
    position: relative;
    color: transparent;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
