/**
 * PK Design Gift Subscriptions - Styles
 * Version: 1.2.1
 * Updated to match Bird Ultrasound site theme
 */

:root {
    --gift-primary: #ff9900;
    --gift-primary-hover: #e68a00;
    --gift-primary-light: rgba(255, 153, 0, 0.1);
    --gift-dark: #4c565c;
    --gift-text: #333333;
    --gift-text-light: #666666;
    --gift-bg-light: #f7f7f7;
    --gift-border: #e0e0e0;
    --gift-white: #ffffff;
}

.page-template-gift-subscription .template-page {
    padding-top: 0;
    padding-bottom: 0;
}

.page-template-gift-subscription .container-wrap.main-title {
    display: none;
}

.page-template-gift-subscription .kleo-main-header {
    border-bottom: 0 !important;
}

/* Base Page Styles */
.gift-subscription-page {
    /* font-family: 'Montserrat', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; */
    font-size: 14px;
    line-height: 1.6;
}

/* Full-width section wrapper */
.gift-subscription-page section {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.gift-subscription-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* WordPress Page Content (Spill Section) */
.gift-page-content {
    background-color: var(--gift-dark);
    padding: 50px 20px;
    border-bottom: 1px solid var(--gift-border);
}

.gift-page-content .container {
    max-width: 800px;
    text-align: center;
}

.gift-page-content h1,
.gift-page-content h2 {
    color: var(--gift-white) !important;
    font-size: 4rem;
    margin-bottom: 4rem;
    font-weight: 700;
    margin-top: 0;  
    border-bottom: 1px solid white;
    padding-bottom: 2rem;
}

.gift-page-content p {
    color: var(--gift-white);
    font-size: 2rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.gift-page-content p:last-of-type,
.gift-page-content .signature {
    margin-top: 3rem;
    font-size: 1.75rem;
    /* font-style: italic;
    color: var(--gift-text);
    font-weight: 500; */
}

/* Product Section */
.gift-products-section {
    background-color: var(--gift-white);
    padding: 80px 20px;
}

.gift-products-section h2 {
    text-align: center;
    color: var(--gift-text);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.gift-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.gift-product-card {
    position: relative;
    border: 2px solid var(--gift-border);
    border-radius: 8px;
    padding: 35px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--gift-white);
    display: flex;
    flex-direction: column;
}

.gift-product-card:hover {
    border-color: var(--gift-primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.gift-product-card.selected {
    border-color: var(--gift-primary);
    border-width: 3px;
    box-shadow: 0 10px 30px rgba(255, 153, 0, 0.15);
    background: var(--gift-primary-light);
}

.gift-product-card .card-label {
    display: inline-block;
    background: var(--gift-primary);
    color: var(--gift-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 auto 20px auto;
}

.gift-product-card h3 {
    font-size: 2.5rem;
    margin: 0;
    color: var(--gift-text);
    font-weight: 700;
}

.gift-product-card .price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gift-primary);
    margin: 20px 0;
}

.gift-product-card .price small, 
.gift-product-card .price .subscription-details {
    font-size: 1.75rem;
    color: #777;
    font-weight: 500;
}
 
.gift-product-card.gift-12-month .price .subscription-details {
    display: none;
}

.gift-product-card .price-period {
    font-size: 0.9rem;
    color: #777;
    font-weight: 400;
}

.gift-product-card p {
    color: var(--gift-text-light);
    margin-bottom: 3rem;
    margin-top: 0;
    font-size: 1.5rem;
}

.gift-product-card .select-btn {
    display: inline-block;
    margin-top: auto;
    padding: 8px 40px;
    background-color: transparent;
    border: 2px solid var(--gift-primary);
    color: var(--gift-primary);
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
    margin-left: auto;
    margin-right: auto;
}

.gift-product-card.selected .select-btn,
.gift-product-card .select-btn:hover {
    background-color: var(--gift-primary);
    color: var(--gift-white);
}

/* Hide features list - content covered in spill section */
.gift-product-card .features {
    display: none;
}

/* Popular Badge - for recurring subscription */
.gift-product-card .popular-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #ff9900 0%, #e68a00 100%);
    color: var(--gift-white);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(255, 153, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Per Year Label */
.gift-product-card .per-year {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
    font-weight: 400;
}

/* Gift Option Note - explanatory text below product cards */
.gift-option-note {
    max-width: 700px;
    margin: 30px auto 0;
    padding: 20px;
    background: var(--gift-white);
    border-left: 4px solid var(--gift-primary);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.gift-option-note strong {
    color: var(--gift-dark);
    font-size: 1.05rem;
    font-weight: 700;
}

.gift-option-note h4 {
    color: var(--gift-primary);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.gift-option-note p {
    color: var(--gift-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.gift-option-note ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.gift-option-note ul li {
    color: var(--gift-text-light);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

/* Email Validation Messages */
.email-validation-message {
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 1.15rem;
    line-height: 1.5;
    display: none;
}

.email-validation-message.show {
    display: block;
}

.email-validation-message.error {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    color: #c62828;
}

.email-validation-message.info {
    background-color: #fff8e1;
    border: 1px solid var(--gift-primary);
    color: #e65100;
}

.email-validation-message.success {
    background-color: #e8f5e9;
    border: 1px solid #66bb6a;
    color: #2e7d32;
}

.email-validation-message strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* Gift Details Section */
.gift-details-section {
    background-color: var(--gift-bg-light);
    padding: 80px 20px;
    display: none;
}

.gift-details-section h2 {
    text-align: center;
    color: var(--gift-text) !important;
    font-size: 3.5rem;
    margin-bottom: 4rem;
    font-weight: 700;
    margin-top: 0;  
}

.gift-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.gift-form-container h2,
.email-preview-container h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--gift-dark);
    font-weight: 700;
    text-align: left;
    margin-top: 0;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gift-text);
    font-size: 1.75rem;
}

.form-group .required {
    color: #d32f2f;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gift-border);
    border-radius: 4px;
    font-size: 1.5rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--gift-white);
    margin-bottom: 8px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gift-primary);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 1.15rem;
}

.form-group .char-count {
    text-align: right;
    color: #999;
}

.btn-add-to-cart {
    width: 100%;
    padding: 14px;
    background-color: var(--gift-primary);
    color: var(--gift-white);
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 10px;
}

.btn-add-to-cart:hover {
    background-color: var(--gift-primary-hover);
    transform: translateY(-1px);
}

.btn-add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Email Preview */
.email-preview {
    background: var(--gift-white);
    border: 1px solid var(--gift-border);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 8px;
    padding: 30px;
    font-size: 1.5rem;
}

.email-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gift-border);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.email-header .email-logo {
    width: 40px;
    height: 40px;
    background-color: var(--gift-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gift-white);
    font-weight: bold;
    flex-shrink: 0;
}

.email-header .email-meta {
    flex: 1;
}

.email-header .email-subject {
    font-weight: 600;
    color: var(--gift-text);
    margin-bottom: 0;
}

.email-header .email-to {
    color: #888;
}

.email-body h3 {
    color: var(--gift-text);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.email-body p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: var(--gift-text-light);
}

.email-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.email-body ul li {
    margin-bottom: 8px;
    color: var(--gift-text-light);
}

.email-body .personal-message {
    background: var(--gift-white);
    border-left: 4px solid var(--gift-primary);
    padding: 15px 20px;
    margin: 20px 0;
    font-style: italic;
}

.email-body .personal-message .message-author {
    font-style: normal;
    margin-top: 10px;
    color: var(--gift-text);
}

.email-body .cta-button {
    text-align: center;
    margin: 25px 0;
}

.email-body .cta-button a {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--gift-primary);
    color: var(--gift-white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.email-body .cta-button a:hover {
    background-color: var(--gift-primary-hover);
}

/* How It Works Section - Higher specificity to override theme */
.gift-subscription-page .gift-how-it-works {
    background-color: #4c565c !important;
    padding: 60px 20px;
    color: #ffffff;
}

.gift-subscription-page .gift-how-it-works h2 {
    text-align: center;
    font-size: 3.5rem;
    margin-bottom: 50px;
    color: #ffffff !important;
    font-weight: 700;
    margin-top: 0;
}

.gift-subscription-page .gift-how-it-works .steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.gift-subscription-page .gift-how-it-works .step {
    text-align: center;
    padding: 20px;
}

.gift-subscription-page .gift-how-it-works .step-icon {
    width: 70px;
    height: 70px;
    line-height: 70px;
    background-color: #ff9900 !important;
    color: #ffffff !important;
    border-radius: 50%;
    font-size: 3rem;
    font-weight: 700;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-subscription-page .gift-how-it-works .step h3 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff !important;
    font-weight: 600;
}

.gift-subscription-page .gift-how-it-works .step p {
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.6;
    font-size: 1.5rem;
}

/* Product Card Grid - Two-column layout optimization */
@media (min-width: 768px) {
    .gift-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .gift-products-grid {
        gap: 50px;
    }
    
    .gift-product-card {
        padding: 40px 30px;
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .gift-details-grid {
        grid-template-columns: 1fr;
    }
    
    .gift-subscription-page .gift-how-it-works .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {

    .gift-page-content h1,
    .gift-page-content h2 {
        font-size: 3rem;
    }
    
    .gift-page-content p {
        font-size: 1.5rem;
    }

    .gift-page-content p:last-of-type, .gift-page-content .signature {
        font-size: 1.25rem;
    }
    
    .gift-products-section h2,
    .gift-details-section h2,
    .gift-subscription-page .gift-how-it-works h2 {
        font-size: 2.5rem;
        margin-bottom: 3rem;
    }

    .gift-subscription-page .gift-how-it-works .steps-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .gift-product-card .card-label {
        font-size: 1rem;
    }

    .gift-subscription-page .gift-how-it-works .step h3 {
        font-size: 2rem;
    }
    
    .gift-product-card .price small, .gift-product-card .price .subscription-details {
        font-size: 1.25rem;
    }

    .gift-product-card {
        padding: 25px 20px;
    }

    .gift-details-section {
        padding: 60px 20px 80px 20px;
    }
    
    .gift-product-card .price {
        font-size: 3rem;
    }
    
    .gift-option-note {
        padding: 15px;
    }
    
    .gift-subscription-page .gift-how-it-works {
        padding: 60px 20px 60px 20px;
    }
    
    .gift-subscription-page .gift-how-it-works .step-icon {
        width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 2.5rem;
    }
    
    .email-preview {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .gift-products-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide recurring totals for one-time gift subscriptions in cart and checkout */
body.woocommerce-cart .shop_table.woocommerce-cart-form__contents tbody tr.recurring-total,
body.woocommerce-cart .cart-collaterals .cart_totals .recurring-total,
body.woocommerce-cart .cart-collaterals .cart_totals .recurring-totals,
body.woocommerce-cart .cart-collaterals .cart_totals h2:contains("Recurring totals"),
body.woocommerce-cart .cart-collaterals .cart_totals tr.recurring-subtotal,
body.woocommerce-cart .shop_table.recurring-totals,
body.woocommerce-checkout .shop_table.recurring-total,
body.woocommerce-checkout .woocommerce-checkout-review-order-table + .shop_table,
body.woocommerce-checkout #order_review .recurring-total,
body.woocommerce-checkout #order_review .recurring-totals {
    display: none !important;
}

/* Target the specific WooCommerce Subscriptions recurring totals section */
.cart_totals .shop_table.woocommerce-checkout-review-order-table + .shop_table,
.cart_totals table.shop_table:nth-of-type(2),
#order_review .shop_table:nth-of-type(2) {
    /* This will be controlled by JavaScript for one-time gifts */
}

