:root {
    --primary-color: #2ecc71; 
    --bg-color: #ffffff;
    --addon-bg: #e5e5e5; /* Exact gray from the image */
    --border-color: #d1d1d1; /* Subtle border color from the image */
    --text-color: #333;
    --border-radius: 4px; /* Sharper corners like the image */
}

.modern-cod-container {
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    direction: ltr;
    text-align: left;
}

/* Right-To-Left Support for Arabic */
.modern-cod-container.mcf-rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
}

.modern-cod-container h3 {
    text-align: center;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 25px;
    font-weight: 700;
}

/* --- Input Group Styling (Matching Your Image) --- */
.mcf-form-group {
    margin-bottom: 12px;
}

.mcf-input-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden; 
    background: var(--bg-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* The Gray Box with the Icon */
.mcf-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--addon-bg);
    width: 55px; /* Fixed width to make all icons perfectly align vertically */
    color: #222; /* Dark solid color */
    border-right: 1px solid var(--border-color); /* The vertical divider line */
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Fix border position for Arabic/RTL */
.mcf-rtl .mcf-input-icon {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

/* The Text Input Area */
.mcf-input-wrapper input[type="text"],
.mcf-input-wrapper input[type="tel"] {
    flex: 1;
    border: none !important;
    padding: 14px 15px;
    font-size: 15px;
    color: var(--text-color);
    background: transparent;
    outline: none;
    box-shadow: none !important;
    margin: 0; 
}

/* Placeholder Styling */
.mcf-input-wrapper input::placeholder {
    color: #757575; /* Medium gray placeholder text */
    font-weight: 400;
}

/* Focus States */
.mcf-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}
.mcf-input-wrapper:focus-within .mcf-input-icon {
    color: var(--primary-color);
}

/* Error state for phone */
.mcf-form-group.error .mcf-input-wrapper {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}
.mcf-form-group.error .mcf-input-icon {
    color: #e74c3c;
}

/* --- Quantity Selector Styles (+/-) --- */
.mcf-qty-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mcf-qty-label {
    flex: 1;
    padding: 0 15px;
    color: #757575; /* Match placeholder color */
    display: flex;
    align-items: center;
    gap: 8px;
}

.mcf-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
}

.mcf-qty-controls {
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 5px;
}

.mcf-qty-btn {
    background: #f1f1f1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background 0.2s;
}

.mcf-qty-btn:hover {
    background: #e1e1e1;
}

.mcf-qty-controls input[type="number"] {
    width: 45px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-weight: bold;
    font-size: 16px;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}
.mcf-qty-controls input[type="number"]::-webkit-outer-spin-button,
.mcf-qty-controls input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Order Summary Box --- */
.order-summary-box {
    background: #f0fdf4;
    border: 1px dashed var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
}

.mcf-rtl .summary-row { flex-direction: row-reverse; }

.summary-row strong {
    color: var(--primary-color);
    font-size: 19px;
}

/* --- Submit Button --- */
.modern-submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modern-submit-btn:hover { opacity: 0.9; }
.modern-submit-btn:active { transform: scale(0.98); }
.modern-submit-btn:disabled { background: #95a5a6; cursor: not-allowed; }