/* ─── Mozon Login (exact Figma Make design) ─── */

body.mozon-signin-standalone {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #111827;
}

.mozon-login-page,
#mozon-login-wrapper.mozon-login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: #111827;
}

.mozon-login-page *,
.mozon-login-page *::before,
.mozon-login-page *::after {
    box-sizing: border-box;
}

.mozon-login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #6e1616;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: 0;
}

@supports (-webkit-touch-callout: none) {
    /* iOS: fixed background can be buggy; fall back to scroll */
    .mozon-login-bg {
        background-attachment: scroll;
    }
}

.mozon-login-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Figma gradient overlay: clean background photo + strong maroon tint */
    background: linear-gradient(150.94deg, rgba(110, 22, 22, 0.88) 0%, rgba(139, 28, 28, 0.82) 60%, rgba(90, 14, 14, 0.92) 100%);
}

.mozon-login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 384px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mozon-login-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.mozon-login-logo {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: 0 25px 25px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
    overflow: hidden;
    width: 172.406px;
}

.mozon-login-logo img {
    display: block;
    height: 64px;
    width: 100%;
    object-fit: contain;
}

.mozon-login-title {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.06));
}

.mozon-login-subtitle {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.mozon-login-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    width: 100%;
}

.mozon-login-card-header {
    padding: 20px 32px;
    text-align: center;
    background: linear-gradient(180deg, #8B1C1C 0%, #6E1616 100%);
}

.mozon-login-card-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
}

.mozon-login-card-header p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    line-height: 1.625;
}

.mozon-login-card-body {
    padding: 32px;
}

.mozon-login-card-body .mozon-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.mozon-login-card-body .mozon-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mozon-login-card-body .mozon-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mozon-login-card-body .mozon-message.dry-mode {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.mozon-login-card-body .mozon-field {
    margin-bottom: 20px;
}

.mozon-login-card-body .mozon-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #364153;
}

.mozon-login-card-body .mozon-field label.mozon-text-center {
    text-align: center;
    margin-bottom: 12px;
}

.mozon-login-card-body .mozon-field input {
    width: 100%;
    height: 56px;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 600;
    line-height: normal;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s ease;
    outline: none;
    text-align: center;
    caret-color: #8B1C1C;
}

.mozon-login-card-body .mozon-field input:focus {
    border-color: #8B1C1C;
}

.mozon-login-card-body .mozon-field input::placeholder {
    color: #9ca3af;
}

.mozon-login-card-body #mozon-mobile {
    direction: ltr;
    text-align: center;
    letter-spacing: 3.6px;
}

.mozon-login-card-body #mozon-otp {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5em;
    color: #8B1C1C;
    height: 3.5rem;
    padding-left: 16px;
    padding-right: 16px;
}

.mozon-login-card-body .mozon-field-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #99a1af;
    text-align: center;
}

.mozon-login-card-body .mozon-button {
    display: block;
    width: 100%;
    height: 52px;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s ease, background 0.2s ease;
}

.mozon-login-card-body .mozon-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mozon-login-card-body .mozon-button:not(:disabled):active {
    transform: scale(0.98);
}

.mozon-login-card-body .mozon-button-primary {
    color: #ffffff;
    background: linear-gradient(170.77deg, #8B1C1C 0%, #6E1616 100%);
}

.mozon-login-card-body .mozon-button-primary:hover:not(:disabled) {
    background: linear-gradient(170.77deg, #6E1616 0%, #8B1C1C 100%);
}

.mozon-login-card-body .mozon-button-primary:disabled {
    /* Figma: keep the maroon gradient at 40 % opacity; global disabled rule sets opacity: 0.4 */
    background: linear-gradient(170.77deg, #8B1C1C 0%, #6E1616 100%);
}

.mozon-login-card-body .mozon-resend {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.mozon-login-card-body .mozon-resend a {
    color: #8B1C1C;
    font-weight: 600;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.mozon-login-card-body .mozon-resend a:hover {
    text-decoration: underline;
}

.mozon-login-card-body .mozon-phase-back {
    margin: 16px 0 0;
    text-align: center;
    font-size: 14px;
}

.mozon-login-card-body .mozon-phase-back a {
    color: #8B1C1C;
    font-weight: 600;
    text-decoration: none;
}

.mozon-login-card-body .mozon-phase-back a:hover {
    text-decoration: underline;
}

.mozon-login-card-body .mozon-mobile-display {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    color: #364153;
}

.mozon-login-card-body .mozon-mobile-display strong {
    display: inline-block;
    margin-inline: 8px;
    font-weight: 700;
    color: #111827;
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
}

.mozon-login-card-body .mozon-change-mobile {
    color: #8B1C1C;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
}

.mozon-login-card-body .mozon-change-mobile:hover {
    text-decoration: underline;
}

.mozon-login-card-body .mozon-forgot-password {
    margin: -8px 0 16px;
    text-align: start;
    font-size: 13px;
}

.mozon-login-card-body .mozon-forgot-password a {
    color: #8B1C1C;
    font-weight: 600;
    text-decoration: none;
}

.mozon-login-card-body .mozon-forgot-password a:hover {
    text-decoration: underline;
}

.mozon-login-card-body #mozon-resend-timer {
    color: #9ca3af;
}

.mozon-login-card-body #mozon-resend-timer span {
    color: #8B1C1C;
    font-weight: 700;
}

.mozon-login-card-body .mozon-debug-log {
    margin-top: 12px;
    padding: 10px 12px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.8em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .mozon-login-page {
        padding: 12px;
    }

    .mozon-login-container {
        max-width: 100%;
    }

    .mozon-login-card-body {
        padding: 22px 20px 26px;
    }

    .mozon-login-logo img {
        height: 52px;
    }

    .mozon-login-title {
        font-size: 20px;
    }
}

.mozon-debug-log {
    margin-top: 12px;
    padding: 10px 12px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.8em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
}

/* Cart Child Display */
.mozon-cart-child {
    margin: 4px 0 0;
    padding: 0;
    font-size: .85em;
    color: #666;
}

.mozon-cart-child dt,
.mozon-cart-child dd {
    display: inline;
    margin: 0;
}

.mozon-cart-child dt::after,
.mozon-cart-child-label::after {
    content: ' ';
}

/* Order Breakdown */
.mozon-order-breakdown {
    margin-top: 24px;
}

.mozon-order-breakdown h3 {
    margin-bottom: 16px;
}

.mozon-child-group {
    margin-bottom: 20px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 6px;
}

.mozon-child-group h4 {
    margin: 0 0 12px;
    color: #7f54b3;
}

.mozon-child-items {
    width: 100%;
    border-collapse: collapse;
}

.mozon-child-items th,
.mozon-child-items td {
    padding: 6px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mozon-child-items tfoot td {
    border-bottom: none;
    border-top: 2px solid #ddd;
}

.mozon-order-child {
    color: #7f54b3;
}

/* Children Screen */
.mozon-children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mozon-child-card {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.mozon-child-card:hover {
    border-color: #7f54b3;
    box-shadow: 0 2px 8px rgba(127,84,179,0.15);
}

.mozon-child-card--loading {
    opacity: 0.6;
    pointer-events: none;
}

.mozon-child-card h3 {
    margin: 0 0 8px;
    color: #333;
}

.mozon-child-meta {
    color: #666;
    font-size: 0.9em;
    line-height: 1.6;
}

.mozon-child-meta span {
    display: inline-block;
    background: #f0e6f6;
    color: #7f54b3;
    padding: 2px 10px;
    border-radius: 12px;
    margin: 4px 2px;
    font-size: 0.85em;
}

/* Active Child Indicator */
.mozon-active-child-bar {
    background: #7f54b3;
    color: #fff;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.95em;
}

.mozon-active-child-bar a {
    color: #e0d0f0;
    text-decoration: underline;
    margin-left: 12px;
}

.mozon-active-child-bar a:hover {
    color: #fff;
}

.mozon-active-child-bar label {
    margin-right: 6px;
    font-weight: 500;
}

.mozon-active-child-bar .mozon-child-selector {
    padding: 5px 28px 5px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
    color: #fff;
    font-size: 0.95em;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 200px;
}

.mozon-active-child-bar .mozon-child-selector option {
    color: #333;
    background: #fff;
}

.mozon-active-child-bar .mozon-child-selector:focus {
    outline: none;
    border-color: #fff;
    background-color: rgba(255,255,255,0.2);
}

.mozon-active-child-bar .mozon-child-selector:disabled {
    opacity: 0.6;
    cursor: wait;
}

.mozon-active-child-bar .mozon-switch-child-page {
    color: #e0d0f0;
    text-decoration: underline;
    margin-left: 12px;
    font-size: 0.85em;
}

.mozon-active-child-bar .mozon-switch-child-page:hover {
    color: #fff;
}

/* My Account Orders List */
.mozon-order-children-list {
    color: #7f54b3;
    font-size: 0.85em;
    display: block;
    margin-top: 2px;
}

/* ─── WoodMart Compatibility ─── */

/* Product grid spacing — scoped to Mozon catalog via body class
   so it doesn't affect non-Mozon products. */
body.mozon-catalog-active .products .product {
    margin-bottom: 1.5rem;
}

body.mozon-catalog-active .products .product .woocommerce-loop-product__title {
    margin: 0.5rem 0 0.25rem;
    font-size: 1rem;
}

body.mozon-catalog-active .products .product .price {
    margin-bottom: 0.5rem;
}

/* Single product page — compact summary for Mozon products */
body.mozon-catalog-active.single-product .summary {
    margin-top: 0;
}

/* ─── CliQ Payment Gateway ─── */

.mozon-cliq-details {
    margin: 12px 0 0;
    padding: 16px;
    background: #f0fdff;
    border: 1px solid #d0f0f2;
    border-radius: 12px;
    color: #2c7a7b;
    font-size: 0.95em;
    line-height: 1.6;
}

.rtl .mozon-cliq-details,
[dir="rtl"] .mozon-cliq-details {
    text-align: right;
    direction: rtl;
}

.mozon-cliq-details strong {
    color: #276749;
}

.mozon-cliq-details em {
    color: #718096;
    font-style: italic;
}

.payment-method-icon-cliq,
.payment-method-icon-mozon_cliq {
    max-height: 32px;
    width: auto;
    object-fit: contain;
}

/* Classic checkout payment box wrapper */
.payment_box .mozon-cliq-details {
    margin-top: 0;
}

/* ─── Invoice Download ─── */

.mozon-invoice-banner {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f0f6ff;
    border: 1px solid #d0e0ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mozon-invoice-label {
    font-weight: 600;
    color: #2c5282;
}

.mozon-invoice-link {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 500;
}

.mozon-invoice-link:hover {
    text-decoration: underline;
}

.mozon-invoice-unavailable {
    color: #a0aec0;
}

.mozon-invoice-download-form {
    display: inline;
    margin: 0;
}

.mozon-invoice-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.mozon-invoice-download-btn:hover {
    background: #2c5282;
}

.rtl .mozon-invoice-banner,
[dir="rtl"] .mozon-invoice-banner {
    text-align: right;
    direction: rtl;
}

/* ─── WPML RTL/LTR direction for English (LTR) WooCommerce pages ─── */
/* cart, shop, orders, edit-address, edit-account, wishlist.
   The <html> dir attribute is forced via the language_attributes filter in
   mozon-woocommerce.php, but these rules guarantee the page body and main
   content containers stay in the correct direction even when a cached
   header/footer leaks an inline RTL override. */

body.mozon-ltr.woocommerce-cart,
body.mozon-ltr.woocommerce-shop,
body.mozon-ltr.woocommerce-archive,
body.mozon-ltr.woocommerce-account,
body.mozon-ltr.woocommerce-wishlist,
body.mozon-ltr .woocommerce-wishlist,
body.mozon-ltr .yith-wishlist,
body.mozon-ltr #yith-wcwl-form {
    direction: ltr;
    text-align: left;
}

body.mozon-rtl.woocommerce-cart,
body.mozon-rtl.woocommerce-shop,
body.mozon-rtl.woocommerce-archive,
body.mozon-rtl.woocommerce-account,
body.mozon-rtl.woocommerce-wishlist,
body.mozon-rtl .woocommerce-wishlist,
body.mozon-rtl .yith-wishlist,
body.mozon-rtl #yith-wcwl-form {
    direction: rtl;
    text-align: right;
}