/* Delbari Retail – Frontend extra styles loaded via wp_enqueue_scripts */

/* WooCommerce checkout overrides in retail mode */
body.dr-retail-body .woocommerce-checkout .dr-checkout-notice {
    background: color-mix(in srgb, var(--dr-color, #1565c0) 8%, white);
    border-right: 4px solid var(--dr-color, #1565c0);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: .9rem;
    color: #1a237e;
}

/* Cart page in retail mode */
body.dr-retail-body .woocommerce-cart-form,
body.dr-retail-body .cart-collaterals {
    direction: rtl;
    font-family: var(--dr-font-family, 'IRANSansWeb', 'Vazirmatn', Tahoma, Arial, sans-serif);
}

/* Mini cart open state */
.dr-cart-modal.dr-open { display: block !important; }

/* Header user menu */
.dr-header-inner .dr-header-user { position: relative; margin-right: auto; margin-left: 8px; }
.dr-header-inner .dr-header-cart { margin-right: 0; }
.dr-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    padding: 7px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    max-width: 200px;
}
.dr-user-toggle:hover { background: rgba(255,255,255,.25); }
.dr-user-icon { display: inline-flex; align-items: center; color: #fff; flex-shrink: 0; }
.dr-user-icon svg { display: block; stroke: currentColor; }
.dr-user-name { overflow: hidden; text-overflow: ellipsis; }
.dr-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    z-index: 1100;
    overflow: hidden;
}
.dr-user-dropdown[hidden] { display: none !important; }
body.dr-retail-body .dr-user-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #c62828;
    font-size: .9rem;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s, color .15s;
}
body.dr-retail-body .dr-user-dropdown a:hover {
    background: #fdecea;
    color: #c62828;
}
body.dr-retail-body .dr-user-dropdown a:last-child {
    border-bottom: none;
}

.dr-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    padding: 7px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    margin-right: auto;
    margin-left: 8px;
    white-space: nowrap;
}
.dr-login-btn:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
}

/* ── Retail shell base ─────────────────────────────────────── */
html,
body.dr-retail-body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.dr-retail-body {
    font-family: var(--dr-font-family, 'IRANSansWeb', 'Vazirmatn', Tahoma, Arial, sans-serif);
    direction: rtl;
}

body.dr-retail-body a {
    text-decoration: none;
    color: inherit;
}

body.dr-retail-body img {
    max-width: 100%;
    height: auto;
}

body.dr-retail-body .dr-header .dr-logo-img,
body.dr-retail-body .dr-header .dr-logo-link svg {
    flex-shrink: 0;
    max-width: none;
}

body.dr-retail-body .dr-header .dr-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

body.dr-retail-body .dr-header .dr-logo-link svg {
    width: 38px;
    height: 38px;
}

/* ── Shared header ─────────────────────────────────────────── */
.dr-header {
    width: 100%;
    background: linear-gradient(135deg, #1a237e 0%, #283593 60%, #1565c0 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dr-header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 70px;
    min-width: 0;
}

.dr-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
}

.dr-logo-img {
    height: 48px;
    width: auto;
    max-width: none;
    object-fit: contain;
    flex-shrink: 0;
}

.dr-site-name {
    font-size: calc(1.3rem + 7px);
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.dr-header-search {
    flex: 1;
    max-width: 450px;
    min-width: 0;
}

.dr-header-search form {
    display: grid;
    grid-template-columns: auto 1fr;
    direction: ltr;
    width: 100%;
    align-items: stretch;
}

.dr-header-search button {
    grid-column: 1;
    background: #e53935;
    color: #fff;
    border: none;
    padding: 9px 10px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: inherit;
    font-size: calc(.95rem - 2px);
    font-weight: 600;
    transition: background .2s;
}

.dr-header-search button:hover {
    background: #c62828;
}

.dr-header-search button svg {
    flex-shrink: 0;
}

.dr-header-search input {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: .9rem;
    outline: none;
    font-family: inherit;
    direction: rtl;
}

.dr-header-inner .dr-login-btn,
.dr-header-inner .dr-user-toggle {
    margin-right: auto;
    margin-left: 8px;
    max-width: 100%;
}

.dr-cart-btn {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,.4);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: background .2s;
    text-decoration: none;
}

.dr-cart-btn:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
}

.dr-cart-count {
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mini cart modal */
.dr-cart-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
}

.dr-cart-modal.dr-open {
    display: block;
}

.dr-cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}

.dr-cart-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 380px;
    max-width: 100vw;
    height: auto;
    max-height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.dr-cart-modal.dr-open .dr-cart-panel {
    transform: translateX(0);
}

.dr-cart-panel-header {
    background: #1a237e;
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.dr-cart-panel-header h2 {
    font-size: 1.05rem;
    margin: 0;
}

.dr-cart-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.dr-cart-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px;
}

.dr-mini-cart-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dr-mini-cart-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.dr-mini-cart-item:last-child {
    border-bottom: none;
}

.dr-mini-cart-item__num {
    flex-shrink: 0;
    min-width: 1.4em;
    font-weight: 700;
    color: #666;
    line-height: 1.5;
}

.dr-mini-cart-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dr-mini-cart-item__name {
    font-weight: 600;
    line-height: 1.45;
    color: #333;
}

.dr-mini-cart-item__calc {
    font-size: 0.88em;
    color: #555;
    line-height: 1.4;
}

.dr-cart-footer {
    padding: 16px 20px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.dr-cart-total {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.dr-cart-footer .dr-checkout-btn {
    display: block;
    text-align: center;
    background: #e53935;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 8px;
    text-decoration: none;
}

.dr-cart-footer .dr-checkout-btn:hover {
    background: #c62828;
    color: #fff;
}

.dr-view-cart-link {
    display: block;
    text-align: center;
    color: #1565c0;
    font-size: .88rem;
    padding: 6px;
}

@media (max-width: 420px) {
    .dr-cart-panel {
        width: 100vw;
    }
}

@media (max-width: 900px) {
    .dr-header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        height: auto;
        min-height: 70px;
        padding: 12px 16px;
        gap: 10px;
        align-items: center;
    }

    .dr-logo-link {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 auto;
    }

    .dr-header-inner > .dr-login-btn,
    .dr-header-inner > .dr-header-user {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        margin: 0;
    }

    .dr-header-search {
        grid-column: 1;
        grid-row: 2;
        flex: unset;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }

    .dr-header-cart {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        margin: 0;
    }

    .dr-header .dr-logo-img {
        height: 48px;
    }

    .dr-header .dr-logo-link svg {
        width: 38px;
        height: 38px;
    }

    .dr-site-name {
        font-size: calc(1rem + 7px);
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
    }

    .dr-header-search button {
        padding: 9px 11px;
        gap: 0;
    }

    .dr-header-search .dr-search-btn-label {
        display: none;
    }

    .dr-header-inner .dr-login-btn,
    .dr-header-inner .dr-user-toggle {
        padding: 7px 12px;
        font-size: .82rem;
    }

    .dr-cart-btn {
        padding: 7px 12px;
        font-size: .82rem;
    }
}

/* Header: logo-only variant (login page) */
.dr-header--logo-only .dr-header-inner {
    display: flex;
    height: 70px;
}

@media (max-width: 900px) {
    .dr-header--logo-only .dr-header-inner {
        display: flex;
        min-height: 70px;
        padding: 12px 16px;
    }
}


/* Inactive product cross-store redirect banner */
.dr-inactive-redirect {
    margin: 0 0 20px;
    max-width: 100%;
    padding: 0;
}
.dr-inactive-redirect__inner {
    background: #fff8e1;
    border: 1px solid #ffe0b2;
    border-radius: 10px;
    padding: 10px 12px 11px;
    box-shadow: none;
}
.dr-inactive-redirect__text {
    display: block;
    font-size: .86rem;
    font-weight: 700;
    color: #e65100;
    line-height: 1.6;
}
.dr-inactive-redirect__meta {
    margin-top: 4px;
    font-size: .78rem;
    color: #8d6e63;
    animation: dr-ir-soft-blink 1.6s ease-in-out infinite;
}
.dr-inactive-redirect__track {
    margin-top: 8px;
    height: 5px;
    border-radius: 999px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    overflow: hidden;
}
.dr-inactive-redirect__bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #fb8c00, #ef6c00);
    transition: width .2s linear;
}
.dr-inactive-redirect__now {
    display: inline;
    margin: 0;
    font-size: inherit;
    font-weight: 700;
    color: #1565c0;
    text-decoration: none;
}
.dr-inactive-redirect__now:hover { text-decoration: underline; }
@keyframes dr-ir-soft-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .42; }
}
