/* ================================================================
   AUTH MODAL — Login / Register modal styles
   Dark theme, matching site design.
   ================================================================ */

/* ----------------------------------------------------------------
   Overlay + backdrop
   ---------------------------------------------------------------- */

.flavor-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.14286rem;
    opacity: 1;
}

.flavor-auth-modal[hidden] {
    display: none !important;
}

.flavor-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(0.28571rem);
    -webkit-backdrop-filter: blur(0.28571rem);
}

@keyframes flavorModalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ----------------------------------------------------------------
   Modal container
   ---------------------------------------------------------------- */

.flavor-auth-modal__container {
    position: relative;
    width: 100%;
    max-width: 30rem;
    background: var(--flavor-bg-card, #1a2340);
    border-radius: 1.14286rem;
    padding: 2.28571rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 0 5px 1px rgba(255, 255, 255, 0.2);
    animation: flavorModalSlideUp 0.25s ease;
    z-index: 1;
}

@keyframes flavorModalSlideUp {
    from { opacity: 0; transform: translateY(1.71429rem) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ----------------------------------------------------------------
   Close button
   ---------------------------------------------------------------- */

.flavor-auth-modal__close {
    position: absolute;
    top: 1.14286rem;
    right: 1.14286rem;
    width: 2.57143rem;
    height: 2.57143rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    color: var(--flavor-text-secondary, #8892a8);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.flavor-auth-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--flavor-text-primary, #fff);
}

/* ----------------------------------------------------------------
   Tab bar
   ---------------------------------------------------------------- */

.flavor-auth-modal__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.71429rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.flavor-auth-modal__tab {
    flex: 1;
    padding: 0.85714rem 0;
    background: none;
    border: none;
    border-bottom: 0.14286rem solid transparent;
    color: var(--flavor-text-secondary, #8892a8);
    font-size: 1.07143rem;
    font-weight: 600;
    font-family: var(--font-body, 'Outfit', sans-serif);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.flavor-auth-modal__tab:hover {
    color: var(--flavor-text-primary, #fff);
}

.flavor-auth-modal__tab.active {
    color: var(--flavor-accent-primary, #e84393);
    border-bottom-color: var(--flavor-accent-primary, #e84393);
}

/* ----------------------------------------------------------------
   Panels
   ---------------------------------------------------------------- */

.flavor-auth-modal__panel {
    display: none;
}

.flavor-auth-modal__panel.active {
    display: block;
    animation: flavorPanelFadeIn 0.15s ease;
}

@keyframes flavorPanelFadeIn {
    from { opacity: 0; transform: translateY(0.57143rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   Form fields
   ---------------------------------------------------------------- */

.flavor-auth-modal__field {
    margin-bottom: 1.14286rem;
}

.flavor-auth-modal__field label {
    display: block;
    margin-bottom: 0.42857rem;
    font-size: 0.92857rem;
    font-weight: 500;
    color: var(--flavor-text-secondary, #8892a8);
    font-family: var(--font-body, 'Outfit', sans-serif);
}

.flavor-auth-modal__field input {
    width: 100%;
    padding: 0.85714rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.71429rem;
    color: var(--flavor-text-primary, #fff);
    font-size: 1.07143rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.flavor-auth-modal__field input:focus {
    outline: none;
    border-color: var(--flavor-accent-primary, #e84393);
    background: rgba(255, 255, 255, 0.08);
}

.flavor-auth-modal__field input::placeholder {
    color: var(--flavor-text-muted, #5a6478);
}

/* ----------------------------------------------------------------
   Remember me + forgot password row
   ---------------------------------------------------------------- */

.flavor-auth-modal__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.42857rem;
    font-size: 0.92857rem;
}

.flavor-auth-modal__checkbox {
    display: flex;
    align-items: center;
    gap: 0.42857rem;
    color: var(--flavor-text-secondary, #8892a8);
    cursor: pointer;
    font-family: var(--font-body, 'Outfit', sans-serif);
}

.flavor-auth-modal__checkbox input[type="checkbox"] {
    width: 1.14286rem;
    height: 1.14286rem;
    accent-color: var(--flavor-accent-primary, #e84393);
    cursor: pointer;
}

.flavor-auth-modal__link {
    color: var(--flavor-accent-primary, #e84393);
    text-decoration: none;
    font-family: var(--font-body, 'Outfit', sans-serif);
    transition: opacity 0.2s ease;
}

.flavor-auth-modal__link:hover {
    opacity: 0.8;
}

/* ----------------------------------------------------------------
   Error message
   ---------------------------------------------------------------- */

.flavor-auth-modal__error {
    display: none;
    margin-bottom: 1.14286rem;
    padding: 0.71429rem 1rem;
    background: rgba(235, 87, 87, 0.12);
    border: 1px solid rgba(235, 87, 87, 0.3);
    border-radius: 0.57143rem;
    color: #f87171;
    font-size: 0.92857rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    line-height: 1.4;
}

/* ----------------------------------------------------------------
   Submit button
   ---------------------------------------------------------------- */

.flavor-auth-modal__submit {
    width: 100%;
    padding: 1rem;
    background: var(--flavor-accent-gradient, linear-gradient(135deg, #e84393, #fd79a8));
    border: none;
    border-radius: 0.71429rem;
    color: #fff;
    font-size: 1.07143rem;
    font-weight: 600;
    font-family: var(--font-body, 'Outfit', sans-serif);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.57143rem;
}

.flavor-auth-modal__submit:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-0.07143rem);
}

.flavor-auth-modal__submit:active:not(:disabled) {
    transform: translateY(0);
}

.flavor-auth-modal__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner */
.flavor-auth-modal__spinner {
    width: 1.28571rem;
    height: 1.28571rem;
    border: 0.14286rem solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: flavorSpin 0.6s linear infinite;
}

.flavor-auth-modal__spinner[hidden] {
    display: none;
}

@keyframes flavorSpin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------
   Header user area (hydrated by session.js)
   ---------------------------------------------------------------- */

#flavor-user-area {
    display: flex;
    align-items: center;
    gap: 0.85714rem;
}

/* Login button (guest state) */
.flavor-login-btn {
    display: flex;
    align-items: center;
    gap: 0.42857rem;
    padding: 0.57143rem 1.14286rem;
    background: var(--flavor-accent-gradient, linear-gradient(135deg, #e84393, #fd79a8));
    border: none;
    border-radius: 0.57143rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body, 'Outfit', sans-serif);
    cursor: pointer;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.flavor-login-btn svg {
    width: 1.28571rem;   /* 18px */
    height: 1.28571rem;
    flex-shrink: 0;
}

.flavor-login-btn:hover {
    opacity: 0.9;
}

/* User menu (logged-in state) */
.flavor-user-menu {
    position: relative;
}

.flavor-user-trigger {
    display: flex;
    align-items: center;
    gap: 0.57143rem;
    padding: 0.28571rem 0.57143rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.71429rem;
    color: var(--flavor-text-primary, #fff);
    font-size: 1rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    cursor: pointer;
    transition: background 0.2s ease;
}

.flavor-user-trigger svg {
    width: 0.85714rem;   /* 12px */
    height: 0.85714rem;
    flex-shrink: 0;
}

.flavor-user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.flavor-user-avatar {
    width: 2.28571rem;
    height: 2.28571rem;
    border-radius: 50%;
    object-fit: cover;
}

.flavor-user-name {
    max-width: 7.14286rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User dropdown */
.flavor-user-dropdown {
    position: absolute;
    top: calc(100% + 0.57143rem);
    right: 0;
    min-width: 12.85714rem;
    background: var(--flavor-bg-card, #1a2340);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.85714rem;
    padding: 0.57143rem;
    box-shadow: 0 0.85714rem 2.28571rem rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.57143rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.flavor-user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.flavor-user-dropdown a {
    display: block;
    padding: 0.71429rem 1rem;
    color: var(--flavor-text-secondary, #8892a8);
    text-decoration: none;
    font-size: 1rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    border-radius: 0.57143rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.flavor-user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--flavor-text-primary, #fff);
}

/* Cart wrapper & link */
.flavor-cart-wrapper {
    position: relative;
}

.flavor-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.85714rem;
    height: 2.85714rem;
    color: var(--flavor-text-secondary, #8892a8);
    text-decoration: none;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.flavor-cart-link svg {
    width: 1.42857rem;   /* 20px */
    height: 1.42857rem;
}

.flavor-cart-link:hover {
    color: var(--flavor-text-primary, #fff);
}

.flavor-cart-count {
    position: absolute;
    top: 0.14286rem;
    right: 0;
    min-width: 1.28571rem;
    height: 1.28571rem;
    padding: 0 0.35714rem;
    background: var(--flavor-accent-primary, #e84393);
    border-radius: 0.64286rem;
    color: #fff;
    font-size: 0.78571rem;
    font-weight: 700;
    font-family: var(--font-body, 'Outfit', sans-serif);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Mini cart dropdown */
.flavor-mini-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 21.42857rem;
    max-height: 28.57143rem;
    background: var(--flavor-bg-card, #1a2340);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.85714rem;
    box-shadow: 0 0.57143rem 2.28571rem rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    font-family: var(--font-body, 'Outfit', sans-serif);
    opacity: 0;
    transform: translateY(-0.57143rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.flavor-mini-cart-dropdown.open {
    opacity: 1;
    transform: translateY(0);
}

.flavor-mini-cart-items {
    max-height: 18.57143rem;
    overflow-y: auto;
    padding: 0.57143rem 0;
}

.flavor-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 0.71429rem;
    padding: 0.57143rem 1rem;
}

.flavor-mini-cart-thumb {
    width: 2.85714rem;
    height: 3.71429rem;
    object-fit: cover;
    border-radius: 0.28571rem;
    flex-shrink: 0;
}

.flavor-mini-cart-thumb-placeholder {
    width: 2.85714rem;
    height: 3.71429rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.28571rem;
    flex-shrink: 0;
}

.flavor-mini-cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.14286rem;
    min-width: 0;
}

.flavor-mini-cart-item-name {
    font-size: 0.92857rem;
    color: var(--flavor-text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flavor-mini-cart-item-price {
    font-size: 0.85714rem;
    color: var(--flavor-accent-primary, #e84393);
    font-weight: 600;
}

.flavor-mini-cart-empty {
    padding: 1.71429rem 1rem;
    text-align: center;
    color: var(--flavor-text-secondary, #8892a8);
    font-size: 0.92857rem;
}

.flavor-mini-cart-actions {
    display: flex;
    gap: 0.57143rem;
    padding: 0.71429rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.flavor-mini-cart-btn {
    flex: 1;
    padding: 0.57143rem 0.85714rem;
    border-radius: 0.57143rem;
    font-size: 0.92857rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-body, 'Outfit', sans-serif);
    transition: background 0.15s ease, opacity 0.15s ease;
}

.flavor-mini-cart-btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--flavor-text-primary, #fff);
}

.flavor-mini-cart-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--flavor-text-primary, #fff);
}

.flavor-mini-cart-btn--primary {
    background: var(--flavor-accent-primary, #e84393);
    color: #fff;
}

.flavor-mini-cart-btn--primary:hover {
    opacity: 0.9;
    color: #fff;
}

@media (max-width: 480px) {
    .flavor-mini-cart-dropdown {
        width: 18.57143rem;
        right: -0.71429rem;
    }
}

/* ----------------------------------------------------------------
   Mobile responsive
   ---------------------------------------------------------------- */

@media (max-width: 480px) {
    .flavor-auth-modal__container {
        max-width: 100%;
        padding: 1.71429rem 1.42857rem;
        border-radius: 1.14286rem 1.14286rem 0 0;
        margin-top: auto;
    }

    .flavor-auth-modal {
        align-items: flex-end;
        padding: 0;
    }

    .flavor-user-name {
        display: none;
    }

    .flavor-user-trigger svg {
        display: none;
    }

    .flavor-login-btn span {
        display: none;
    }

    .flavor-login-btn {
        width: 2.85714rem;
        height: 2.85714rem;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
}

@media (max-width: 768px) {}
