/* Simple COD Checkout — Arabic (RTL) form; logical properties only. */

.scc-hide-atc form.cart .quantity,
.scc-hide-atc form.cart .single_add_to_cart_button {
    display: none !important;
}

.scc-wrap {
    --scc-accent: #1f7a4d;
    --scc-border: #d9dde3;
    --scc-danger: #c62828;
    --scc-muted: #6b7280;
    margin-block: 1.5em;
    padding: 1.25em;
    border: 2px solid var(--scc-accent);
    border-radius: 10px;
    background: #fff;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.scc-title {
    margin: 0 0 1em;
    font-size: 1.15em;
    text-align: center;
}

.scc-form {
    display: grid;
    gap: 0.9em;
    margin: 0;
}

.scc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9em;
}

@media (max-width: 480px) {
    .scc-row {
        grid-template-columns: 1fr;
    }
}

.scc-field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.scc-field label {
    font-size: 0.9em;
    font-weight: 600;
}

.scc-field label span {
    color: var(--scc-danger);
}

.scc-field input,
.scc-field select {
    width: 100%;
    min-height: 44px;
    padding: 0.5em 0.75em;
    border: 1px solid var(--scc-border);
    border-radius: 6px;
    background: #fff;
    font-size: 16px; /* prevents iOS zoom on focus */
    box-sizing: border-box;
}

.scc-field input:focus,
.scc-field select:focus {
    outline: none;
    border-color: var(--scc-accent);
    box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.15);
}

.scc-field input[type="tel"] {
    direction: ltr;
    text-align: right;
}

.scc-field [hidden] {
    display: none !important;
}

.scc-field select:disabled {
    opacity: 0.6;
}

.scc-invalid {
    border-color: var(--scc-danger) !important;
}

.scc-field[data-error]::after {
    content: attr(data-error);
    color: var(--scc-danger);
    font-size: 0.8em;
}

.scc-hp {
    position: absolute !important;
    inset-inline-start: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.scc-summary {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    padding: 0.9em;
    border-radius: 8px;
    background: #f6f7f9;
}

.scc-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    font-weight: 600;
}

.scc-qty {
    display: inline-flex;
    border: 1px solid var(--scc-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.scc-qty-btn {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.2em;
    cursor: pointer;
}

.scc-qty-btn:hover {
    background: #eef0f3;
}

.scc-qty input {
    width: 48px;
    border: 0;
    border-inline: 1px solid var(--scc-border);
    text-align: center;
    font-size: 16px;
    -moz-appearance: textfield;
}

.scc-qty input::-webkit-outer-spin-button,
.scc-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scc-totals {
    margin: 0;
    font-size: 0.95em;
}

.scc-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1em;
}

.scc-totals dt {
    color: var(--scc-muted);
    font-weight: normal;
}

.scc-totals dd {
    margin: 0;
}

.scc-totals .scc-grand {
    margin-block-start: 0.3em;
    padding-block-start: 0.3em;
    border-block-start: 1px dashed var(--scc-border);
    font-size: 1.1em;
    font-weight: 700;
}

.scc-totals .scc-grand dt {
    color: inherit;
    font-weight: 700;
}

.scc-error {
    padding: 0.7em 0.9em;
    border-radius: 6px;
    background: #fdecea;
    color: var(--scc-danger);
    font-size: 0.9em;
}

.scc-error[hidden] {
    display: none;
}

.scc-form .scc-submit {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 8px;
    background: var(--scc-accent);
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    animation: scc-pulse 2s ease-in-out infinite;
}

.scc-form .scc-submit:hover {
    filter: brightness(1.08);
}

.scc-form .scc-submit:disabled {
    opacity: 0.7;
    cursor: wait;
    animation: none;
}

@keyframes scc-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
    .scc-form .scc-submit {
        animation: none;
    }
}

/* Sticky "order now" button */
.scc-sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 9999;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(110%);
    transition: transform 0.25s ease;
    direction: rtl;
}

.scc-sticky.is-visible {
    transform: translateY(0);
}

.scc-sticky-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    width: 100%;
    max-width: 640px;
    min-height: 52px;
    margin: 0 auto;
    padding: 0 1em;
    border: 0;
    border-radius: 8px;
    background: #1f7a4d;
    color: #fff;
    font: inherit;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    animation: scc-pulse 2s ease-in-out infinite;
}

.scc-sticky-price:empty {
    display: none;
}

.scc-sticky-price {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
    .scc-sticky {
        transition: none;
    }
    .scc-sticky-btn {
        animation: none;
    }
}
