/* ========================================
   DASHBOARD.CSS - My Account Page
   ======================================== */

.dashboard-section {
    padding-top: 120px;
    padding-bottom: 80px;
    background: var(--light-bg);
    min-height: 90vh;
}

/* ---------- Guest state ---------- */
.dashboard-guest {
    text-align: center;
    background: var(--secondary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 80px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.dashboard-guest i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.dashboard-guest h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.dashboard-guest p {
    color: var(--gray-text);
    margin-bottom: 25px;
}

/* ---------- Layout ---------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* ---------- Sidebar ---------- */
.dashboard-sidebar {
    background: var(--secondary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 30px 25px;
    position: sticky;
    top: 100px;
}

.dashboard-user-card {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 14px;
    overflow: hidden;
}

.dashboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-user-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.dashboard-user-card p {
    color: var(--gray-text);
    font-size: 0.85rem;
    word-break: break-all;
}

.dashboard-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.dashboard-nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    border-radius: var(--radius);
    text-align: left;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.dashboard-notification-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #E53935;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(229,57,53,.12);
}
.dashboard-notification-badge[hidden] { display: none; }

.dashboard-nav-btn i {
    width: 18px;
    color: var(--gray-text);
    transition: var(--transition);
}

.dashboard-nav-btn:hover {
    background: var(--light-bg);
}

.dashboard-nav-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

.dashboard-nav-btn.active i {
    color: var(--accent);
}

.dashboard-signout {
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: #E74C3C;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.dashboard-signout:hover {
    background: #E74C3C;
    color: var(--secondary);
    border-color: #E74C3C;
}

/* ---------- Content ---------- */
.dashboard-content {
    background: var(--secondary);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px;
    min-height: 400px;
}

.dashboard-content h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.dashboard-panel {
    display: none;
}

.dashboard-panel.active {
    display: block;
}

/* ---------- Profile form ---------- */
.dashboard-avatar-uploader {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-avatar-preview {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--light-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    overflow: hidden;
}

.dashboard-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.dashboard-upload-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.dashboard-avatar-hint {
    font-size: 0.75rem;
    color: var(--gray-text);
    margin-top: 8px;
}

.dashboard-profile-form {
    max-width: 420px;
}

.dashboard-profile-form .form-group {
    margin-bottom: 20px;
}

.dashboard-profile-form label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.dashboard-profile-form input[type="text"],
.dashboard-profile-form input[type="email"],
.dashboard-profile-form input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: var(--transition);
}

.dashboard-profile-form input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.dashboard-profile-form input:disabled {
    background: var(--light-bg);
    color: var(--gray-text);
    cursor: not-allowed;
}

.communication-preferences {
    max-width: 520px;
    margin-top: 32px;
    padding-top: 26px;
    border-top: 1px solid var(--border-color);
}

.communication-preferences-heading { margin-bottom: 16px; }
.communication-preferences-heading h2 { margin-bottom: 5px; font-size: 1rem; }
.communication-preferences-heading p { color: var(--gray-text); font-size: .78rem; line-height: 1.55; }

.communication-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    margin-bottom: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
}

.communication-option input { margin-top: 3px; accent-color: var(--accent); }
.communication-option strong, .communication-option small { display: block; }
.communication-option strong { font-size: .82rem; }
.communication-option small { margin-top: 3px; color: var(--gray-text); font-size: .72rem; line-height: 1.4; }
.communication-option:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.browser-push-option { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; cursor: default; }
.browser-push-option > i { color: var(--gray-text); font-size: .85rem; }
.dashboard-push-btn { min-height: 36px; padding: 8px 13px; border: 1px solid var(--primary); border-radius: 8px; background: var(--primary); color: var(--secondary); font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease; }
.dashboard-push-btn:hover:not(:disabled) { transform: translateY(-1px); }
.dashboard-push-btn.is-enabled { border-color: #1E7D49; background: rgba(30, 125, 73, .08); color: #1E7D49; }
.dashboard-push-btn:disabled { opacity: .55; cursor: not-allowed; }
.communication-preferences-status { min-height: 20px; margin-top: 9px; color: #1E7D49; font-size: .76rem; }
.communication-preferences-status.is-error { color: #C0392B; }

.whatsapp-verification-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    color: #8B6C12;
    font-size: 0.78rem;
    font-weight: 500;
}

.verification-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.whatsapp-verification-status.is-verified { color: #1E8E4F; }
.whatsapp-verification-status.is-error { color: #C0392B; }

.dashboard-verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 13px;
    border: 1px solid #128C7E;
    border-radius: var(--radius);
    background: #fff;
    color: #128C7E;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.dashboard-verify-btn.is-primary {
    margin-top: 0;
    background: #128C7E;
    color: #fff;
}

.dashboard-verify-btn:disabled { opacity: .55; cursor: wait; }

.whatsapp-code-panel {
    margin: -4px 0 20px;
    padding: 14px;
    border: 1px solid rgba(18, 140, 126, .25);
    border-radius: var(--radius);
    background: rgba(18, 140, 126, .05);
}

.whatsapp-code-panel label {
    display: block;
    margin-bottom: 7px;
    font-size: .8rem;
    font-weight: 500;
}

.whatsapp-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.whatsapp-code-row input {
    min-width: 0;
    letter-spacing: .22em;
}

@media (max-width: 420px) {
    .whatsapp-code-row { grid-template-columns: 1fr; }
    .whatsapp-code-row .dashboard-verify-btn { width: 100%; }
}

/* ---------- Orders ---------- */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.order-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 22px;
    background: var(--light-bg);
}

.order-card-header .order-number {
    font-weight: 600;
    font-size: 0.95rem;
}

.order-card-header .order-date {
    color: var(--gray-text);
    font-size: 0.82rem;
}

.order-status {
    padding: 5px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.order-status.processing { background: rgba(212, 175, 55, 0.15); color: #a5821f; }
.order-status.pending_confirmation,
.order-status.awaiting_payment { background: rgba(212, 175, 55, 0.15); color: #a5821f; }
.order-status.confirmed { background: rgba(142, 68, 173, 0.14); color: #7d3c98; }
.order-status.shipped    { background: rgba(52, 152, 219, 0.15); color: #2980b9; }
.order-status.delivered  { background: rgba(39, 174, 96, 0.15); color: #1e8449; }
.order-status.cancelled  { background: rgba(231, 76, 60, 0.15); color: #c0392b; }

.order-card-body {
    padding: 18px 22px;
}

.order-line-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0;
}

.order-line-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--light-bg);
}

.order-line-item .item-name {
    flex: 1;
    font-size: 0.9rem;
}

.order-line-item .item-qty {
    color: var(--gray-text);
    font-size: 0.82rem;
}

.order-line-item .item-price {
    font-weight: 600;
    font-size: 0.9rem;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}
.order-card-footer span { color: var(--gray-text); font-size: .8rem; font-weight: 400; }
.order-card-footer a { color: #8B6C12; }
.order-card.is-focused-order { border-color: #B58B16; box-shadow: 0 12px 34px rgba(181, 139, 22, .18); }

.notification-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 25px; }
.notification-panel-heading h1 { margin-bottom: 0; }
.notification-mark-all { border: 0; background: none; color: #8B6C12; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.dashboard-notifications { display: grid; gap: 10px; }
.dashboard-notification { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 13px; padding: 15px; border: 1px solid var(--border-color); border-radius: 11px; }
.dashboard-notification.is-unread { background: rgba(212,175,55,.07); border-color: rgba(212,175,55,.35); }
.dashboard-notification.is-unread::after { content: ''; position: absolute; top: 13px; right: 13px; width: 8px; height: 8px; border-radius: 50%; background: #E53935; }
.notification-kind { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--light-bg); color: var(--accent); }
.dashboard-notification h3 { font-size: .9rem; padding-right: 18px; }
.dashboard-notification p { color: var(--gray-text); font-size: .8rem; line-height: 1.55; margin-top: 3px; }
.dashboard-notification time { display: block; color: #999; font-size: .68rem; margin-top: 7px; }

.orders-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-text);
}

.orders-empty i {
    font-size: 2.5rem;
    color: var(--border-color);
    margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
    }
    .dashboard-content {
        padding: 25px;
    }
}

@media (max-width: 600px) {
    .dashboard-section { padding-top: 90px; padding-bottom: 45px; overflow-x: hidden; }
    .dashboard-sidebar { padding: 18px 14px; }
    .dashboard-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-nav-btn { min-width: 0; min-height: 48px; padding: 9px 6px; justify-content: center; text-align: center; font-size: .72rem; flex-direction: column; gap: 4px; }
    .dashboard-nav-btn i { width: auto; }
    .dashboard-notification-badge { position: absolute; top: 2px; right: 6px; }
    .dashboard-content { padding: 20px 14px; min-width: 0; }
    .dashboard-content h1 { font-size: 1.45rem; margin-bottom: 20px; }
    .dashboard-avatar-uploader { align-items: flex-start; }
    .order-line-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; }
    .order-line-item .item-qty { grid-column: 2; }
    .order-line-item .item-price { grid-column: 3; grid-row: 1 / span 2; }
    .order-card-header, .order-card-body, .order-card-footer { padding-left: 13px; padding-right: 13px; }
    .notification-panel-heading { align-items: flex-start; }
    .notification-mark-all { white-space: nowrap; }
    .browser-push-option { grid-template-columns: auto minmax(0, 1fr); }
    .browser-push-option .dashboard-push-btn { grid-column: 2; justify-self: start; }
}
