/* Gift Cards Frontend Styles */

.bsgc-product-form {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: var(--wp--preset--color--background, #fafafa);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Image */
.bsgc-header-image {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
}

.bsgc-gift-card-header {
    max-width: 100%;
    height: auto;
    /* max-height: 200px; */
    /* border-radius: 8px; */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.bsgc-gift-card-header:hover {
    transform: scale(1.02);
}

/* Amount Selection */
.bsgc-predefined-amounts {
    margin-bottom: 1.5rem;
}

.bsgc-predefined-amounts>label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--wp--preset--color--contrast, #000000);
    font-size: 1.1rem;
}

.bsgc-amount-option {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--wp--preset--color--base, #ffffff);
    position: relative;
}

.bsgc-amount-option:hover {
    border-color: var(--wp--preset--color--accent-4, #007cba);
    background-color: var(--wp--preset--color--base, #f5f5f5);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.bsgc-amount-option input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--wp--preset--color--accent-4, #007cba);
}

.bsgc-amount-option input[type="radio"]:checked+* {
    font-weight: 600;
}

.bsgc-amount-option:has(input[type="radio"]:checked) {
    border-color: var(--wp--preset--color--accent-4, #007cba);
    background-color: var(--wp--preset--color--background-dark, #e6f3ff);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Custom Amount */
.bsgc-custom-amount {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--wp--preset--color--base, #ffffff);
    border-radius: 4px;
    border: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
}

.bsgc-custom-amount label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--wp--preset--color--contrast, #000000);
}

.bsgc-custom-amount input[type="number"] {
    width: 100%;
    max-width: 200px;
    padding: 0.75rem;
    border: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
    border-radius: 4px;
    font-size: 1.1rem;
    transition: border-color 0.2s ease;
}

.bsgc-custom-amount input[type="number"]:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent-4, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* Recipient Information */
.bsgc-recipient-info {
    background: var(--wp--preset--color--base, #ffffff);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
    margin-top: 1.5rem;
}

.bsgc-recipient-info h4 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--wp--preset--color--contrast, #000000);
    font-size: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--wp--preset--color--accent-4, #f0f0f0);
}

.bsgc-recipient-info p {
    margin-bottom: 1.25rem;
}

.bsgc-recipient-info p:last-child {
    margin-bottom: 0;
}

.bsgc-recipient-info label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.bsgc-recipient-info input,
.bsgc-recipient-info textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--wp--preset--color--accent-4, #e5e5e5);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background: #fafafa;
    box-sizing: border-box;
}

.bsgc-recipient-info input:focus,
.bsgc-recipient-info textarea:focus {
    outline: none;
    border-color: var(--wp--preset--color--accent-1, #007cba);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.bsgc-recipient-info textarea {
    resize: vertical;
    min-height: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bsgc-product-form {
        margin: 1rem 0;
        padding: 1rem;
    }

    .bsgc-header-image {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .bsgc-gift-card-header {
        max-height: 150px;
    }

    .bsgc-amount-option {
        display: block;
        margin-right: 0;
        margin-bottom: 0.5rem;
        text-align: center;
    }

    .bsgc-custom-amount input[type="number"] {
        max-width: none;
    }

    .bsgc-recipient-info {
        padding: 1rem;
    }
}

/* Animation for showing/hiding custom amount */
.bsgc-custom-amount {
    transition: all 0.3s ease;
    overflow: hidden;
}

.bsgc-custom-amount[style*="display: none"] {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
}

/* Price formatting */
.woocommerce-Price-amount {
    font-weight: 600;
    color: var(--wp--preset--color--contrast, #000000);
}

/* Focus states for accessibility */
.bsgc-amount-option:focus-within {
    border-color: var(--wp--preset--color--accent-1, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Loading states */
.bsgc-loading {
    opacity: 0.6;
    pointer-events: none;
}

.bsgc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--wp--preset--color--accent-1, #007cba);
    border-radius: 50%;
    animation: bsgc-spin 1s linear infinite;
}

@keyframes bsgc-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}