/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
.ekolive-calc {
    --ek-primary: #009640;       /* Ekolive Green */
    --ek-primary-dark: #007a33;
    --ek-bg-gray: #f9f9f9;
    --ek-border: #e0e0e0;
    --ek-text: #333;
    --ek-text-light: #666;
	container-type: inline-size;
    container-name: ekcalc;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ek-text);
    box-sizing: border-box;
    line-height: 1.5;
}

.ekolive-calc *, .ekolive-calc *::before, .ekolive-calc *::after {
    box-sizing: inherit;
}

/* ==========================================================================
   2. HIDDEN SOURCE
   ========================================================================== */
.ek-hidden-table-source, #tablepress-3_wrapper, #tablepress-3 {
    display: none !important;
}

/* ==========================================================================
   3. LAYOUT STRUCTURE (50/50 Split)
   ========================================================================== */
.ek-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    background: #fff;
    border: 1px solid var(--ek-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.ek-left-pane {
    width: 50%;
    min-width: 320px;
    padding: 30px;
    background: #fff;
    z-index: 5;
    border-right: 1px solid var(--ek-border);
}

.ek-summary-target {
    width: 0;
    opacity: 0;
    background: #fafafa;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.ek-summary-target.is-open {
    width: 50%;
    opacity: 1;
}

/* ==========================================================================
   4. CALCULATOR UI ELEMENTS
   ========================================================================== */
.ek-title {
    margin: 0 0 5px 0;
    color: var(--ek-primary);
    font-size: 22px;
    font-weight: 700;
}
.ek-subtitle {
    margin: 0 0 25px 0;
    color: var(--ek-text-light);
    font-size: 14px;
}

/* ==========================================================================
   CROP GRID (UPDATED LAYOUT)
   ========================================================================== */
/* ==========================================================================
   CROP GRID (Strict 2 Columns)
   ========================================================================== */
.ek-crops-grid {
    display: grid;
    /* Force exactly 2 columns of equal width */
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    margin-bottom: 30px;
}

/* Mobile: Stack to 1 column on very small screens */
@media (max-width: 480px) {
    .ek-crops-grid {
        grid-template-columns: 1fr;
    }
}

.ek-crop-btn {
    appearance: none;
    border: 2px solid #eee;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    
    /* FLEX LAYOUT: Label Left, Icons Right */
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: space-between; 
    
    min-height: 50px;
    transition: all 0.2s;
    padding: 10px 15px;
    text-align: left;
    width: 100%;
}

.ek-crop-btn .ek-crop-label {
    flex: 1; /* Label takes up all free space */
    margin-right: 10px; 
    line-height: 1.2;
}

/* New Class for Icon Wrapper */
.ek-icon-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0; 
}

.ek-crop-btn:hover {
    border-color: #f5e856;
    background: #d5ead8;
    transform: translateY(-2px);
}

.ek-crop-btn.is-active {
    border-color: var(--ek-primary);
    background: #d2f2a7;
    box-shadow: 0 0 0 1px var(--ek-primary);
}

.ek-crop-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    line-height: 1.2;
    /* CHANGE 3: Label takes available space */
    flex: 1; 
    margin-right: 10px; 
}

/* CHANGE 4: Style for the Icon Group (Right Side) */
.ek-icon-group {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0; /* Prevents icons from squishing */
}

/* --- 1. THE DOSE CARDS (Inline Layout) --- */
/* ==========================================================================
   RECOMMENDATION DOSE GRID (Strict Side-by-Side)
   ========================================================================== */
.ek-dose-grid {
    display: grid;
    /* Force exactly 2 columns. */
    grid-template-columns: 1fr 1fr; 
    gap: 15px;
    margin-bottom: 5px;
    width: 100%;
}

.ek-dose-item {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
     font-weight: 600;
    color: #333;
    /* Ensure text doesn't break the layout */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ek-dose-item .ek-pill {
    font-size: 12px;
    font-weight: 600;
    color: var(--ek-primary-dark);
    text-align: right;
	border: 1px solid #cce5d6;
	border-radius: 10px;
    padding: 5px 5px;
	background: #edf7e9;
    white-space: nowrap; /* Keep "25 l/ha" on one line */
}

/* Optional: Stack on very small mobile screens */
@media (max-width: 400px) {
    .ek-dose-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 2. THE RESULT CARDS (Inline Layout) --- */
/* ==========================================================================
   RESULTS SECTION (Strict Side-by-Side)
   ========================================================================== */
.ek-results {
    display: grid;
    /* Force exactly 2 columns. */
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    align-items: center;
    
    background: #d2f2a7;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed var(--ek-primary);
    margin-bottom: 5px;
}

.ek-result-item {
    /* No flex width needed, the grid handles it */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
     font-weight: 600;
    color: #333;
    min-width: 0; /* Prevents overflow issues */
}

/* Optional: Stack on very small mobile screens */
@media (max-width: 400px) {
    .ek-results {
        grid-template-columns: 1fr;
    }
}
    /* Ensure it doesn't break layout */
    width: 100%;
    min-width: 0;
    padding: 10px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
}

.ek-result-item .ek-product {
    font-size: 16px;
	font-weight: 600;
   / text-transform: uppercase;/
    letter-spacing: 0.5px;
    color: #555;
    margin-bottom: 0;
    text-align: left;
    margin-right: 10px;
	text-wrap: wrap;
}

.ek-result-item .ek-input {
    width: 100%; 
    max-width: 120px;
    text-align: right;
    background: #fff;
    border: none;
    border-top: none;
    padding: 0;
    font-weight: 600; 
    color: var(--ek-primary);
    font-size: 14px; 
}

/* --- INPUT FIELDS --- */
.ek-input-row {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
    align-items: flex-start;
}

.ek-field-group { flex: 1; }
.ek-field-group label {
    display: block;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 5px;
    color: var(--ek-text);
	text-align: center;
}

.ek-input-wrap {
    display: flex;
    border: 1px solid var(--ek-border);
    border-radius: 4px;
    overflow: hidden;
}

.ek-input {
    border: none;
    padding: 10px;
    width: 100%;
    font-size: clamp(14px, 5cqw, 22px);
    
    /* Ensure it doesn't break layout */
    width: 100%;
    min-width: 0;
    outline: none;
}

.ek-unit-toggle {
    display: flex;
    border-left: 1px solid var(--ek-border);
}

.ek-unit-toggle button {
    background: #f5f5f5;
    border: none;
    padding: 0 10px;
    font-size: 15px;
    cursor: pointer;
    color: #888;
}
.ek-unit-toggle button.active {
    background: var(--ek-primary);
    color: #fff;
}

/* --- CUSTOM RANGE SLIDER (FORCE GREEN) --- */
input[type="range"].ek-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    margin: 10px 0; 
    accent-color: #009640; 
}

input[type="range"].ek-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #009640 !important; 
    background: #009640 !important;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    margin-top: -8px; 
    position: relative;
    z-index: 2;
}

input[type="range"].ek-range::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #009640 !important;
    background: #009640 !important;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
    border: none;
}
input[type="range"].ek-range:focus { outline: none; }


.ek-footnote {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 5px;
}

.ek-trigger-btn {
    background: #f7e328;
    border: 2px solid var(--ek-text);
    color: #555;
    padding: 10px 10px;
    border-radius: 30px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
	margin-top: 1px;
	width: 250px;
	
}
.ek-trigger-btn:hover {
    background: var(--ek-text);
    color: #fff;
}

/* ==========================================================================
   5. SUMMARY PANEL CONTENTS
   ========================================================================== */
.ek-slide-panel-inner {
    padding: 30px;
    position: relative;
    height: 100%;
}

.ek-close-panel {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #aaa;
    line-height: 1.;
    z-index: 10;
}
.ek-close-panel:hover { color: #333; }

.ek-panel-img-wrap {
    display: flex;           
    align-items: center;     
    gap: 20px;               
    margin-bottom: 30px;
    text-align: left;
}

.ek-panel-img-wrap img {
    width: 50%;            
    height: 240px;
    border-radius: 00%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 0;
	margin-top:10px;
}

.ek-panel-img-wrap  {
    margin: 0;
    font-size: 46px ;        
    color: var(--ek-primary);
    line-height: 1.2;
}

.ek-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ek-panel-col {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.ek-panel-col h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--ek-text);
    border-bottom: 2px solid var(--ek-primary);
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: capitalize;
}

.ek-calc-result {
    background: #f0f9f4;
    border: 1px solid #cce5d6;
    color: var(--ek-primary-dark);
    font-weight: 500;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.ek-calc-result strong {
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.ek-app-block { margin-bottom: 15px; }

.ek-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ek-detail-list li {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
    color: #555;
    border-bottom: 1px dotted #eee;
    padding-bottom: 4px;
}

.ek-detail-list strong {
    color: #333;
    font-weight: 600;
}


/* --- AREA HEADER (Label + Radios Inline) --- */
.ek-area-header {
    display: flex;
    justify-content: space-between; /* Pushes Label left, Radios right */
    align-items: center;
    margin-bottom: 8px;
}

/* Reset margin for this specific label so it aligns nicely */
.ek-area-header .ek-label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ek-text);
}

/* Radio Group */
.ek-radios {
    display: flex;
    gap: 15px; /* Space between ha and m2 */
    font-size: 13px;
    color: var(--ek-text-light);
}

.ek-radios label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

/* The actual Radio Circle */
.ek-radios input[type="radio"] {
    accent-color: var(--ek-primary); /* Makes the dot Green */
    cursor: pointer;
    margin: 0;
    width: 14px;
    height: 14px;
}
/* --- NEW AREA HEADER LAYOUT --- */
.ek-input-header {
    display: flex;
    justify-content: space-between; /* Pushes Label Left, Radios Right */
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.ek-input-header .ek-label {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--ek-text);
}

/* --- RADIO GROUP (Top Right) --- */
.ek-radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ek-radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

/* Custom Green Radio Dot */
.ek-radio-item input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin: 0;
    position: relative;
    cursor: pointer;
    background: #fff;
}

.ek-radio-item input[type="radio"]:checked {
    border-color: var(--ek-primary);
}

.ek-radio-item input[type="radio"]:checked::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--ek-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 900px) {
    .ek-wrapper { flex-direction: column; }
    .ek-left-pane { width: 100%; border-right: none; border-bottom: 1px solid var(--ek-border); }
    .ek-summary-target { width: 100%; height: 0; opacity: 1; }
    .ek-summary-target.is-open { width: 100%; height: auto; min-height: 600px; border-top: 5px solid var(--ek-primary); }
    .ek-input-row { flex-direction: column; gap: 15px; }
    .ek-results { flex-direction: column; } 
}

/* ==========================================================================
   10. FULL OVERLAY STYLES (Fixed "Half-Width" Issue)
   ========================================================================== */

/* 1. The Main Wrapper (The Anchor) */
.ek-wrapper {
    position: relative !important; 
    overflow: hidden !important; 
}

/* 2. CRITICAL FIX: Release the "Trap" */
/* We force the columns to be 'static' so the panel ignores their width */
.ek-left-pane, .ek-right-pane {
    position: static !important; 
}

/* 3. The Panel Container (Default: HIDDEN) */
.ek-summary-target {
    display: none !important;      /* Gone by default */
    opacity: 0;
    pointer-events: none;          /* Cannot click invisible panel */
    
    /* Position: Cover the ENTIRE ek-wrapper */
    position: absolute !important; 
    top: 0;
    left: 0;
    width: 100% !important;        /* Full Width of Wrapper */
    height: 100% !important;       /* Full Height of Wrapper */
    background: #fff; 
    z-index: 999;                  /* Sit on top */
    
    padding-bottom: 40px !important;
    box-sizing: border-box;
    overflow-y: auto;              /* Scroll inside if needed */
}

/* 4. Open State (When "Show Summary" is clicked) */
.ek-summary-target.is-open {
    display: block !important;
    opacity: 1;
    pointer-events: auto;          /* Now you can click it */
    animation: ekSlideUp 0.3s ease-out forwards;
}

@keyframes ekSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 5. Inner Content Width */
.ek-slide-panel-inner {
    width: 100%;
    max-width: 800px; 
    margin: 0 auto;   
    padding-bottom: 40px;
}

/* 6. Close Button (Sticky Top Right) */
.ek-close-panel {
    position: sticky; 
    top: 0;
    float: right;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    z-index: 1000; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.ek-close-panel:hover {
    background: #f0f0f0;
    color: #d00;
    border-color: #d00;
}

/* ==========================================================================
   SUMMARY HEADER (Side-by-Side Layout)
   ========================================================================== */
.ek-panel-img-wrap {
    display: flex;             /* align items side-by-side */
    align-items: center;       /* vertically center them */
    justify-content: left;   /* horizontally center the pair */
    gap: 20px;                 /* space between image and title */
    margin-bottom: 30px;
    clear: both;
    text-align: left;          /* Reset text align */
}

/* Image: Remove centered margins */
.ek-panel-img-wrap img {
    max-width: 50%;          /* Adjust icon size */
    margin: 0 !important;      /* Remove "auto" margins */
    display: block;
    /object-fit: contain;/
}

/* Title: Align text to the left */
.ekolive-calc .ek-panel-img-wrap h3 {
    margin: 0;
    text-align: left;          /* Text aligns away from the image */
    font-size: 32px !important; 
    color: var(--ek-primary);
    line-height: 1.1;
}

/* Mobile Fallback: Stack them on small phones */
@media (max-width: 480px) {
    .ek-panel-img-wrap {
        flex-direction: column; /* Stack vertically */
        text-align: center;
    }
    .ek-panel-img-wrap img {
        margin: 0 auto 10px !important;
    }
    .ekolive-calc .ek-panel-img-wrap h3 {
        text-align: center;
    }
}

/* Panel Grid */
.ek-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ek-panel-col { background: #f9f9f9; padding: 20px; border-radius: 8px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }
.ek-panel-col h3 { margin-top: 0; font-size: 18px; color: #333; border-bottom: 2px solid var(--ek-primary); padding-bottom: 10px; margin-bottom: 15px; }

.ek-calc-result { font-size: 16px; margin-bottom: 15px; padding: 10px; background: #fff; border: 1px solid var(--ek-primary); border-radius: 6px; }
.ek-app-block { margin-bottom: 15px; }
.ek-detail-list { list-style: none; padding: 0; margin: 5px 0 0; font-size: 13px; color: #555; }
.ek-detail-list li { margin-bottom: 4px; line-height: 1.4; }

@media (max-width: 600px) {
    .ek-panel-grid { grid-template-columns: 1fr; }
}