/**
 * Shaper COD Order Form Styles
 * Optimized for Conversion - Offer Grid Logic
 */

/* Form Container */
.shaper-cod-form-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Intro banner */
.shaper-cod-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    direction: rtl;
    border: 1px dashed #ced4da;
}

.shaper-cod-intro-icon {
    font-size: 18px;
}

/* Form */
.shaper-cod-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Reduced from 16px */
}

/* Fields */
.shaper-cod-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Reduced from 6px */
}

.shaper-cod-field label {
    font-size: 15px;
    /* Increased for better mobile visibility */
    font-weight: 600;
    color: #1a1a1a;
    text-align: right;
    direction: rtl;
}

.shaper-cod-field input[type="text"],
.shaper-cod-field input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    /* Darker border for visibility */
    border-radius: 8px;
    font-size: 15px;
    text-align: right;
    direction: rtl;
    transition: all 0.2s;
    background: #fff;
    /* Pure white background */
    height: 44px;
    color: #000;
}

.shaper-cod-field input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* 3️⃣ Phone Field MUST look special - Clean Version */
.shaper-cod-field input[type="tel"] {
    direction: ltr;
    text-align: right;
    /* Aligned right to match other fields */
    letter-spacing: 1px;
    font-family: 'Courier New', monospace, sans-serif;
    font-size: 16px !important;
    font-weight: 700 !important;
    /* Removed padding-left and thick border */
}

.shaper-cod-field input::placeholder {
    color: #999;
    font-family: inherit;
    font-weight: 400;
    opacity: 1;
}

/* Phone error */
.shaper-cod-phone-error {
    color: #dc3545;
    font-size: 12px;
    text-align: right;
    direction: rtl;
    margin-top: 2px;
}

/* === OFFER CARD DESIGN === */
.shaper-cod-offers {
    margin: 8px 0;
    /* Reduced margin */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ... existing offer card styles ... */
/* (Skipping unmodified parts for brevity, will rely on diff) */

/* 6️⃣ Color select - Secondary Style */
.shaper-cod-var-select-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    /* Lighter color */
    margin-bottom: 3px;
    text-align: left;
    direction: ltr;
}

.shaper-cod-var-select {
    width: 100%;
    padding: 0 10px;
    height: 40px;
    /* Increased height to prevent clipping */
    border: 1px solid #ccc;
    /* Darker border */
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #000;
    transition: all 0.2s;
}

.shaper-cod-var-select:focus {
    background: #fff;
    border-color: #666;
}

.shaper-cod-offer-card {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
    padding: 12px;
}

/* Selected State */
.shaper-cod-offer-card.active {
    border: 2px solid #000;
    background: #fff;
    padding: 11px;
    /* Compensate for 2px border */
}

/* Layout of the Card Header */
.shaper-cod-offer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: ltr;
    /* Keeps price on right, title on left */
}

/* Radio Button Styling (Hidden default, custom circle) */
.shaper-cod-radio-circle {
    width: 20px;
    height: 20px;
    border: 1px solid #adb5bd;
    border-radius: 50%;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shaper-cod-offer-card.active .shaper-cod-radio-circle {
    border-color: #000;
    border-width: 5px;
    /* Creates the dot effect */
}

/* Offer Title Section */
.shaper-cod-offer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shaper-cod-offer-title {
    font-weight: 700;
    font-size: 15px;
    color: #000;
}

.shaper-cod-offer-badge {
    display: inline-block;
    background: #e62e04;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
    width: fit-content;
    text-transform: uppercase;
}

/* Price Section */
.shaper-cod-offer-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.shaper-cod-current-price {
    font-weight: 700;
    font-size: 16px;
    color: #000;
}

.shaper-cod-old-price {
    font-size: 12px;
    text-decoration: line-through;
    color: #999;
}

/* Embedded Variation Selectors (Only visible in Active Card) */
.shaper-cod-variations-inline {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f3f5;
    display: none;
}

.shaper-cod-offer-card.active .shaper-cod-variations-inline {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;
}

.shaper-cod-var-select-group {
    width: 100%;
    min-width: 0;
}

.shaper-cod-product-separator {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 5px;
    font-weight: 600;
}

.shaper-cod-item-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;

    /* Visual Grouping */
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ededed;
}

/* Inline Label Logic (Option 1) */
.shaper-cod-select-wrapper {
    position: relative;
    width: 100%;
}

.shaper-cod-inline-label {
    position: absolute;
    right: 8px;
    /* Flex alignment for robust vertical centering */
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;

    font-size: 14px;
    font-weight: 700;
    color: #222;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;

    /* "Badge" Styling for clarity */
    /* Remove padding/margin from wrapper, style the inner text if needed, 
       but here we style the container to act as the badge */
}

/* Inner span if you need background, but let's keep it simple: 
   We just center the whole block. 
   If the badge look is needed, we apply it to a child or this container.
   Let's keep the previous badge style but apply it via flex.
*/
.shaper-cod-inline-label::after {
    content: attr(data-label);
    /* Optional if using attribute */
    /* We can't use pseudo-element easily for content, so stick to styling the element itself */
}

/* Re-applying badge styles correctly to the flex container */
.shaper-cod-inline-label {
    /* Resetting the background/padding to be consistent */
    background: transparent;
    padding: 0;
    border: none;
}

.shaper-cod-inline-label span {
    background: #f3f3f3;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    display: block;
}

.shaper-cod-var-select {
    width: 100%;
    /* Flexible height */
    height: auto !important;
    min-height: 42px;

    /* Layout: Arrow on Left, Value on Left, Label on Right */
    /* Reduced arrow size -> Reduced left padding for balance */
    padding: 10px 100px 10px 32px;

    border: 1px solid #aaa;
    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;
    /* Bolder for premium feel */
    line-height: 1.5;

    background: #fff;
    color: #000;
    transition: all 0.2s;

    /* Cross-browser cleanup & Custom Arrow on LEFT */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 9px;
    /* Smaller arrow */

    /* Force LTR for Value Readability */
    direction: ltr;
    text-align: left;
}

.shaper-cod-var-select:hover {
    border-color: #666;
}

.shaper-cod-var-select:focus {
    background-color: #fff;
    /* Fix arrow disappearance */
    border-color: #000;
    /* Premium black border */
    box-shadow: 0 0 0 1px #000;
    /* Thicker border visual */
    outline: none;
}

/* Subtle Divider between products (e.g. in bundles) */
.shaper-cod-var-select-group+.shaper-cod-var-select-group {
    border-top: 1px dashed #e5e5e5;
    padding-top: 12px;
    margin-top: 12px;
}

/* Submit Button & Footer */
.shaper-cod-actions {
    margin-top: 10px;
}

.shaper-cod-submit {
    width: 100%;
    padding: 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.shaper-cod-submit:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

.shaper-cod-submit:active {
    transform: translateY(1px);
}

.shaper-cod-submit svg {
    fill: currentColor;
    width: 18px;
    height: 18px;
}

/* Totals (Hidden mostly as prices are on cards, but good for summary) */
/* Totals (Restored by user request) */
.shaper-cod-totals {
    display: block;
    margin-top: 15px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    color: #000;
    font-size: 16px;
    border: 1px dashed #d1d1d1;
}

/* Animations */
@keyframes shaper-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shaper-cod-offer-card {
    animation: shaper-fade-in 0.3s ease-out;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .shaper-cod-form-wrapper {
        padding: 15px;
        margin: 15px 0;
        border-radius: 0 0 12px 12px;
        /* Blend with product image usually */
    }

    .shaper-cod-offer-card {
        padding: 10px;
    }

    .shaper-cod-variations-inline {
        flex-direction: column;
    }
}

/* Product Separator in Bundle Logic */
.shaper-cod-product-separator {
    width: 100%;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    margin-top: 5px;
    color: #000;
    text-align: right;
    /* RTL Standard */
    direction: rtl;
}