:root {
    --primary-color: #2ecc71; 
    --bg-color: #ffffff;
    --addon-bg: #e5e5e5;
    --border-color: #d1d1d1;
    --text-color: #333;
    --border-radius: 4px;
}

.modern-cod-container {
    background: #ffffff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 20px 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: 20px;
    font-size: 1.3rem;
    font-weight: 700;
}

/* --- Input Group Styling --- */
.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: 48px; 
    flex-shrink: 0; 
    color: #222;
    border-right: 1px solid var(--border-color);
    transition: color 0.3s ease, background-color 0.3s ease;
}

.mcf-input-icon svg {
    width: 18px; 
    height: 18px;
}

/* 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;
    min-width: 0; 
    border: none !important;
    padding: 12px 14px; 
    font-size: 14px; 
    color: var(--text-color);
    background: transparent;
    outline: none;
    box-shadow: none !important;
    margin: 0; 
}

/* Placeholder Styling */
.mcf-input-wrapper input::placeholder {
    color: #888;
    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;
    padding-right: 8px; 
}

.mcf-rtl .mcf-qty-wrapper {
    padding-right: 0;
    padding-left: 8px; 
}

.mcf-qty-label {
    flex: 1;
    min-width: 0; 
    padding: 8px 14px;
    color: #757575; 
    display: flex;
    align-items: center;
    flex-wrap: wrap; 
    gap: 8px;
    font-size: 14px;
}

.mcf-badge {
    background: #e74c3c;
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap; 
}

.mcf-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0; 
}

.mcf-qty-btn {
    background: #f1f1f1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px; 
    height: 28px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background 0.2s;
    padding: 0;
}

.mcf-qty-btn:hover {
    background: #e1e1e1;
}

.mcf-qty-controls input[type="number"] {
    width: 35px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-weight: bold;
    font-size: 15px;
    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: #f8fafc;
    border: 1px dashed var(--border-color);
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #555;
}

.mcf-rtl .summary-row { flex-direction: row-reverse; }

.summary-row strong {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 800;
}

/* --- Submit Button --- */
.modern-submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-submit-btn:hover { opacity: 0.9; }
.modern-submit-btn:active { transform: scale(0.98); }
.modern-submit-btn:disabled { background: #95a5a6; cursor: not-allowed; }