/**
 * Helvita Master CSS
 * LOCKED: Configurator, Mini-cart, and Pop-ups.
 * UPDATED: Refined Checkout Layout (Section 8).
 */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&display=swap');

:root {
    --h-dark: #14323c;
    --h-teal: #02c0ab;
    --h-yellow: #fec751;
    --h-teal-light: rgba(2, 192, 171, 0.1);
    --h-border: #eef2f5;
    --h-bg: #f8fafc;
    --h-error: #d63031;
    --h-grey-btn: #f1f5f9; /* Subtle grey for variation buttons */
}

/* RESET & SCOPING */
#helvita-configurator-wrapper, 
#helvita-checkout-app, 
.helvita-modal-content,
.woocommerce-account .woocommerce-MyAccount-content {
    box-sizing: border-box; 
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; 
    color: var(--h-dark);
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ===============================
   1. CONFIGURATOR GRID
   =============================== */
#helvita-configurator-wrapper { 
    display: flex; flex-wrap: wrap; gap: 30px; max-width: 1200px; margin: 0 auto; width: 100%; align-items: flex-start; position: relative; 
}
.helvita-main-col { flex: 1 1 65%; width: 65%; }
.helvita-sidebar-col { flex: 1 1 30%; width: 30%; min-width: 280px; position: sticky; top: 30px; align-self: flex-start; }

.helvita-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; width: 100%; }
.helvita-card { background: #fff; border: 1px solid var(--h-border); border-radius: 8px; overflow: hidden; position: relative; display: flex; flex-direction: column; height: 100%; transition: box-shadow 0.2s; }
.helvita-card:hover { box-shadow: 0 5px 20px rgba(0,0,0,0.08); border-color: var(--h-teal); }

.card-info-wrap { position: absolute; top: 10px; left: 10px; z-index: 5; cursor: pointer; color: var(--h-teal); font-size: 16px; font-weight: 500; width: 20px; height: 20px; border: 1px solid var(--h-teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; transition: 0.2s; }
.card-info-wrap:hover { background: var(--h-teal); color: #fff; }

.card-image { padding: 20px 10px 10px; height: 120px; display: flex; align-items: center; justify-content: center; }
.card-image img { max-height: 100%; max-width: 100%; object-fit: contain; }
.card-content { padding: 10px 15px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.3; color: var(--h-dark); min-height: 40px; display: flex; align-items: center; justify-content: center; }

.card-controls { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--h-border); background: #fff; }
.ctrl-btn { width: 24px; height: 24px; border: none; background: transparent; color: var(--h-dark); font-size: 20px; font-weight: 400; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.ctrl-btn:hover:not(:disabled) { color: var(--h-teal); transform: scale(1.2); }
.ctrl-btn:disabled { color: #e0e0e0; cursor: not-allowed; }
.qty-input { width: 40px; border: none; background: transparent; font-weight: 700; font-size: 16px; text-align: center; color: var(--h-dark); }

/* ===============================
   2. MINI-CART (WITH CONTROLS)
   =============================== */
.helvita-sticky-box { background: #fff; border: 1px solid var(--h-border); border-radius: 8px; padding: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); }
.helvita-sticky-box h3 { margin-top: 0; color: var(--h-dark); font-size: 18px; font-weight: 700; padding-bottom: 15px; border-bottom: 1px solid var(--h-border); margin-bottom: 15px; }

.mini-cart-list { min-height: 60px; margin-bottom: 20px; max-height: 350px; overflow-y: auto; }
.mini-cart-item { display: flex; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f9f9f9; font-size: 14px; }
.mini-cart-item img { width: 35px; height: 35px; object-fit: contain; margin-right: 12px; }

.mini-item-controls { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.mini-ctrl-btn { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--h-border); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; padding: 0; line-height: 1; }
.mini-ctrl-btn:hover { border-color: var(--h-teal); color: var(--h-teal); }
.mini-item-qty { font-weight: 700; font-size: 14px; min-width: 15px; text-align: center; }

/* ===============================
   3. MODAL DESIGN
   =============================== */
.helvita-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(20, 50, 60, 0.7); z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.helvita-modal-content { background: #fff; padding: 0; border-radius: 12px; width: 95%; max-width: 500px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }

.modal-header { background: var(--h-teal-light); padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(2, 192, 171, 0.2); }
.modal-header h2 { margin: 0; font-size: 16px; color: var(--h-dark); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.modal-close, .modal-close-var { background: none; border: none; font-size: 28px; color: var(--h-dark); cursor: pointer; padding: 0; line-height: 1; }
.modal-body { padding: 40px 30px; text-align: center; }

#variation-buttons-container { 
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 10px 0; 
}

#variation-buttons-container .helvita-main-btn {
    flex: 0 1 calc(33.33% - 12px); 
    min-width: 100px;
    padding: 15px 5px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    background-color: var(--h-grey-btn); 
    color: var(--h-dark); 
    border: 1px solid transparent;
    text-transform: none;
    line-height: 1.2;
}

#variation-buttons-container .helvita-main-btn:hover {
    background-color: #e2e8f0;
    border-color: var(--h-teal);
    transform: translateY(-2px);
    color: var(--h-dark);
}

/* ===============================
   4. UPSELL MODAL
   =============================== */
.upsell-product-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; }
.upsell-product-card img { width: 140px; height: 140px; object-fit: contain; }
.badge-free { background: var(--h-yellow); color: var(--h-dark); font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 20px; display: inline-block; }

.modal-footer { padding: 0 30px 30px; display: flex; flex-direction: column; align-items: center; }
.link-skip { background: none; border: none; color: #999; margin-top: 15px; cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: underline; text-align: center; }
.link-skip:hover { color: var(--h-dark); }

/* ===============================
   5. SHARED COMPONENTS
   =============================== */
.helvita-main-btn { width: 100%; background: var(--h-dark); color: #fff; border: none; padding: 14px; border-radius: 4px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.2s; text-align: center; }
.helvita-main-btn:hover { background: #0e242b; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ===============================
   6. DASHBOARD (MY ACCOUNT)
   =============================== */
.woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; margin: 0; border: 1px solid var(--h-border); border-radius: 4px; overflow: hidden; }
.woocommerce-MyAccount-navigation li a { display: block; padding: 15px 20px; color: #666; text-decoration: none; font-weight: 500; transition: 0.2s; border-bottom: 1px solid var(--h-border); }
.woocommerce-MyAccount-navigation li.is-active a { background-color: var(--h-dark); color: #fff; }
.helvita-info-box-green { background: #f0fdf4; border: 1px solid #bbf7d0; padding: 25px; border-radius: 12px; margin-bottom: 30px; }

/* ===============================
   7. RESPONSIVE (LOCKED)
   =============================== */
@media screen and (max-width: 900px) {
    #helvita-configurator-wrapper { flex-direction: column; }
    .helvita-main-col { width: 100%; order: 2; padding-bottom: 140px; }
    .helvita-sidebar-col { width: 100%; order: 1; position: fixed; bottom: 0; left: 0; z-index: 9999; margin: 0; top: auto; }
    .helvita-sticky-box { border-radius: 16px 16px 0 0; border: none; border-top: 1px solid #eee; box-shadow: 0 -10px 30px rgba(0,0,0,0.1); padding: 20px; display: flex; align-items: center; justify-content: space-between; }
    .helvita-sticky-box h3, .mini-cart-list { display: none !important; }
    .helvita-sticky-box::before { content: "Ihre Auswahl"; font-weight: 700; font-size: 18px; color: var(--h-dark); }
    .helvita-main-btn { width: auto; padding: 12px 30px; font-size: 14px; }
    .helvita-product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    #variation-buttons-container .helvita-main-btn { flex: 0 1 calc(50% - 12px); }
}




/* ===============================
   8. PREMIUM CHECKOUT REFINEMENT
   =============================== */

/* Page Background updated to your specific light mint */
body.page-template-checkout-app { 
    background-color: #e5f9f6; 
}

/* Hide unwanted Step Tracker and WooCommerce notices */
.checkout-steps,
#helvita-checkout-app ~ .woocommerce-message, 
.page-template-checkout-app .woocommerce-message,
.page-template-checkout-app .woocommerce-info { 
    display: none !important; 
}

/* 8.1 NARROW MODERN CARD DESIGN */
#helvita-checkout-app {
    max-width: 750px; /* Made the form more narrow */
    margin: 40px auto 60px;
    background: transparent;
}

.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 35px 40px; 
    margin-bottom: 24px;
    border: 1px solid #eef2f5;
    box-shadow: 0 4px 15px rgba(20, 50, 60, 0.03);
}

/* Header with Pencil Icon */
.form-section h3 {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #14323c;
    margin: 0 0 25px 0;
}

.form-section h3::before {
    content: "✎"; /* Pencil icon */
    width: 32px;
    height: 32px;
    background-color: #fec751; /* Brand Yellow */
    color: #14323c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* 8.2 FIELD STYLING (Spaced & Rounded) */
.form-group { 
    margin-bottom: 12px; 
} 

.form-group input, 
.form-group select {
    width: 100%;
    height: 50px;
    border: 1.5px solid #0274b3; /* Consistent blue border */
    background: #fff;
    border-radius: 8px; /* Individually rounded fields */
    padding: 0 16px;
    font-size: 15px;
    color: #14323c;
}

.form-group input:focus {
    border-color: #02c0ab;
    box-shadow: 0 0 0 3px rgba(2, 192, 171, 0.1);
    outline: none;
}

/* 8.3 RADIO BUTTON STYLING (FIXED STACKING) */
.beratung-options, 
.woocommerce-checkout #helvita-checkout-app .form-row .input-radio-container {
    display: flex !important;
    flex-direction: column !important; /* Forces vertical stacking */
    gap: 15px !important;
    margin-top: 15px !important;
}

.beratung-options label,
#helvita-checkout-app .input-radio-label {
    display: flex !important;
    align-items: center !important; /* Centers radio circle with text */
    gap: 12px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #14323c !important;
    margin-bottom: 5px !important;
}

.beratung-options input[type="radio"],
#helvita-checkout-app input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    accent-color: #02c0ab !important; /* Brand teal center */
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Adjusts the space between each option */
}

.info-text {
    padding: 12px;
    border-left: 3px solid #01bca7;
    background-color: #e5f9f6;
    border-radius: 8px;
    
    /* Optional: Ensures the box doesn't touch elements below it */
    margin-bottom: 15px; 
}

/* 8.5 FOOTER ACTION */
.form-actions { 
    display: flex; 
    justify-content: center; 
    margin-top: 40px; 
}

.helvita-main-btn {
    background: #14323c;
    color: #fff;
    padding: 16px 80px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    transition: 0.2s;
}

.helvita-main-btn:hover {
    background: #0e242b;
    transform: translateY(-2px);
}


/* ===============================
   8.6 STEP 3: INSURANCE SECTION
   =============================== */

/* Change Pencil to Number 1 for Step 3 first card */
.insurance-section h3::before {
    content: "1" !important; 
    font-size: 14px;
    font-weight: 700;
}

/* Ensure Step 3 radios stack vertically */
.insurance-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

/* Helper link for insurance number */
.insurance-helper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #14323c;
    margin-top: 12px;
    cursor: pointer;
    font-weight: 500;
}

/* Dynamic field toggle */
.hidden-insurance-fields {
    display: none;
    margin-top: 20px;
}

.hidden-insurance-fields.active {
    display: block;
}