/* ============================
   COD Order Form - Frontend CSS
   ============================ */

.cod-form-wrapper {
    margin: 24px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Badge */
.cod-form-badge-wrap {
    margin-bottom: 16px;
}

.cod-form-shipping-badge {
    display: inline-block;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 50px;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* Title */
.cod-form-title {
    margin: 0 0 16px 0;
    padding: 0;
    line-height: 1.3;
}

/* ============================
   Offers
   ============================ */
.cod-form-offers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.cod-form-offer {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.cod-form-offer:hover {
    border-color: #bbb;
}

.cod-form-offer.selected {
    border-color: #e67e22;
    box-shadow: 0 0 0 1px #e67e22;
    background: #fef9f4;
}

.cod-form-offer-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cod-form-offer-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cod-form-offer-radio { flex-shrink: 0; }

.cod-form-radio-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    position: relative;
    transition: border-color 0.2s;
}

.cod-form-offer.selected .cod-form-radio-dot {
    border-color: #e67e22;
}

.cod-form-offer.selected .cod-form-radio-dot::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #e67e22;
}

.cod-form-offer-image { flex-shrink: 0; }
.cod-form-offer-image img {
    width: 48px; height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.cod-form-offer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cod-form-offer-label { font-size: 14px; font-weight: 600; color: #2c3e50; }
.cod-form-offer-discount { font-size: 12px; font-weight: 700; color: #e74c3c; }

.cod-form-offer-prices {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cod-form-offer-original { font-size: 12px; color: #999; text-decoration: line-through; }
.cod-form-offer-final { font-size: 16px; font-weight: 700; color: #2c3e50; }

/* ============================
   Form Fields
   ============================ */
.cod-form-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.cod-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 5px;
}

.cod-form-required { color: #e74c3c; }

.cod-form-field input[type="text"],
.cod-form-field input[type="tel"],
.cod-form-field input[type="email"],
.cod-form-field textarea,
.cod-form-field select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.cod-form-field input:focus,
.cod-form-field textarea:focus,
.cod-form-field select:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

.cod-form-field input.error,
.cod-form-field textarea.error,
.cod-form-field select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.cod-form-field textarea {
    resize: vertical;
    min-height: 70px;
}

.cod-form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.cod-form-field-error {
    display: block;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
}

/* Phone field with dial code */
.cod-form-phone-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cod-form-dial-code {
    position: absolute;
    left: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    pointer-events: none;
    z-index: 1;
}

.cod-form-phone-wrap input[type="tel"] {
    transition: padding-left 0.2s;
}

.cod-form-phone-wrap.has-code input[type="tel"] {
    padding-left: 60px;
}

/* ============================
   Price Summary
   ============================ */
.cod-form-price-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.cod-form-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    padding: 4px 0;
}

.cod-form-price-total {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
    border-top: 1px solid #e0e0e0;
    margin-top: 6px;
    padding-top: 8px;
}

/* ============================
   Submit Button
   ============================ */
.cod-form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    gap: 10px;
    font-family: inherit;
    line-height: 1.3;
    transition: opacity 0.2s, transform 0.1s;
}

.cod-form-submit:hover { opacity: 0.92; }
.cod-form-submit:active { transform: scale(0.98); }
.cod-form-submit:disabled { opacity: 0.7; cursor: not-allowed; }

.cod-form-submit-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cod-form-spinner { display: inline-flex; align-items: center; }

/* ============================
   Button Animations
   ============================ */

/* Pulse */
.cod-form-anim-pulse {
    animation: codPulse 2s ease-in-out infinite;
}
@keyframes codPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(230, 126, 34, 0.4); }
}

/* Shake */
.cod-form-anim-shake {
    animation: codShake 3s ease-in-out infinite;
}
@keyframes codShake {
    0%, 78%, 100% { transform: translateX(0); }
    80% { transform: translateX(-4px); }
    82% { transform: translateX(4px); }
    84% { transform: translateX(-4px); }
    86% { transform: translateX(4px); }
    88% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
    92% { transform: translateX(0); }
}

/* Bounce */
.cod-form-anim-bounce {
    animation: codBounce 2.5s ease-in-out infinite;
}
@keyframes codBounce {
    0%, 80%, 100% { transform: translateY(0); }
    85% { transform: translateY(-6px); }
    90% { transform: translateY(0); }
    93% { transform: translateY(-3px); }
    96% { transform: translateY(0); }
}

/* Glow */
.cod-form-anim-glow {
    animation: codGlow 2s ease-in-out infinite;
}
@keyframes codGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(230, 126, 34, 0.2); }
    50% { box-shadow: 0 0 25px rgba(230, 126, 34, 0.6), 0 0 50px rgba(230, 126, 34, 0.3); }
}

/* Pause animation on hover for better UX */
.cod-form-submit[class*="cod-form-anim-"]:hover {
    animation-play-state: paused;
}

/* ============================
   Messages
   ============================ */
.cod-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.cod-form-message.success {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #a3d9a5;
}

.cod-form-message.error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 600px) {
    .cod-form-offer-inner { gap: 8px; }
    .cod-form-offer-image img { width: 40px; height: 40px; }
    .cod-form-offer-label { font-size: 13px; }
    .cod-form-offer-final { font-size: 14px; }
    .cod-form-submit { font-size: 15px; padding: 12px 16px; }
}
