/* Profile page only. This file does not change the rest of the website. */

.main-content {
    padding-top: 150px;
}

.profile-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 96px;
}

.profile-hero-card,
.profile-panel,
.profile-link {
    background: #ffffff;
    border: 1px solid rgba(26, 43, 74, 0.1);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(26, 43, 74, 0.08);
}

.profile-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
    grid-template-rows: auto 1fr;
    gap: 20px 24px;
    padding: 24px;
    margin-bottom: 18px;
}

.profile-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.profile-avatar {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--primary-navy);
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
}

.profile-hero-details {
    min-width: 0;
}

.profile-hero-details h2 {
    margin: 0 0 4px;
    color: var(--text-dark);
    font-size: 28px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.profile-hero-details p {
    margin: 0;
    color: var(--text-light);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-self: start;
}

.profile-details-grid div {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8f6f1;
}

.profile-details-grid .profile-address {
    grid-column: 1 / -1;
}

.profile-details-grid span,
.tracking-label,
.panel-heading span,
.tracking-items h3 {
    display: block;
    margin-bottom: 5px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-details-grid strong {
    display: block;
    color: var(--text-dark);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.order-status-section {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 0;
    padding-left: 24px;
    border-left: 1px solid var(--border-color);
}

.order-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.order-status-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 18px;
}

.view-all,
.panel-link,
.panel-secondary-link {
    color: var(--primary-navy);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.orders-list {
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding-right: 3px;
}

.order-item {
    width: 100%;
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fbfbfc;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.order-item:hover {
    transform: translateY(-1px);
    border-color: rgba(26, 43, 74, 0.28);
    box-shadow: 0 10px 24px rgba(26, 43, 74, 0.08);
}

.order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-id,
.order-firestore-id,
.order-details span {
    display: block;
}

.order-id {
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 800;
}

.order-firestore-id,
.order-details {
    color: var(--text-light);
    font-size: 12px;
}

.order-status {
    flex: 0 0 auto;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.track-order-btn {
    justify-self: start;
    padding: 8px 12px;
    border: 1px solid var(--primary-navy);
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary-navy);
    font-size: 12px;
    font-weight: 800;
}

.profile-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-links {
    position: sticky;
    top: 150px;
    display: grid;
    gap: 10px;
}

.profile-link {
    width: 100%;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.profile-link:hover,
.profile-link.active {
    border-color: rgba(26, 43, 74, 0.25);
    background: #f8f9fb;
    transform: translateY(-1px);
}

.profile-link-logout {
    color: #a12a2a;
}

.link-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f1eee6;
    color: var(--primary-navy);
}

.profile-link-logout .link-icon {
    background: #fff0f0;
    color: #a12a2a;
}

.link-icon svg {
    width: 21px;
    height: 21px;
}

.link-text {
    min-width: 0;
}

.link-text strong,
.link-text small {
    display: block;
}

.link-text strong {
    font-size: 14px;
    line-height: 1.2;
}

.link-text small {
    margin-top: 2px;
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.25;
}

.link-arrow {
    color: var(--text-light);
    font-size: 22px;
    line-height: 1;
}

.profile-panels {
    min-width: 0;
}

.profile-panel {
    display: none;
    min-height: 452px;
    padding: 24px;
}

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

.panel-heading {
    margin-bottom: 18px;
}

.panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 22px;
    line-height: 1.2;
}

.profile-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-form.compact {
    grid-template-columns: 1fr;
    max-width: 480px;
}

.profile-form label {
    display: grid;
    gap: 7px;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 800;
}

.profile-form .full-row {
    grid-column: 1 / -1;
}

.profile-form input,
.profile-form textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-dark);
    font: inherit;
    font-weight: 500;
    outline: none;
}

.profile-form textarea {
    resize: vertical;
}

.profile-form input:focus,
.profile-form textarea:focus {
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(26, 43, 74, 0.08);
}

.profile-form input:disabled {
    background: #f3f3f3;
    color: var(--text-light);
}

.panel-primary-btn,
.panel-secondary-btn {
    justify-self: start;
    min-height: 44px;
    padding: 12px 18px;
    border: 0;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.panel-primary-btn {
    background: var(--primary-navy);
    color: #ffffff;
}

.panel-secondary-btn {
    background: #eef0f4;
    color: var(--text-dark);
}

.address-preview {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fbfbfc;
    color: var(--text-dark);
    font-size: 14px;
}

.payment-options,
.toggle-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.payment-options label,
.toggle-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 13px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fbfbfc;
    color: var(--text-dark);
    font-weight: 700;
}

.payment-options input,
.toggle-list input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.wishlist-count {
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 13px;
    font-weight: 800;
}

.wishlist-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wishlist-preview-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fbfbfc;
    color: var(--text-dark);
    text-decoration: none;
}

.wishlist-preview-item img {
    width: 62px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
}

.wishlist-preview-item strong,
.wishlist-preview-item small {
    display: block;
}

.wishlist-preview-item strong {
    overflow: hidden;
    color: var(--text-dark);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-preview-item small {
    color: var(--text-light);
    font-size: 12px;
}

.profile-empty-text {
    margin: 0;
    padding: 18px;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

.form-message {
    display: none;
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.form-message.show {
    display: block;
}

.form-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.form-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

@media (min-width: 1280px) {
    .main-content {
        padding-top: 170px;
    }

    .profile-page {
        width: min(1240px, calc(100% - 48px));
    }

    .profile-layout {
        grid-template-columns: 340px minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .profile-hero-card {
        grid-template-columns: 1fr;
    }

    .order-status-section {
        grid-column: auto;
        grid-row: auto;
        padding-left: 0;
        padding-top: 18px;
        border-left: 0;
        border-top: 1px solid var(--border-color);
    }

    .orders-list {
        max-height: 420px;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-links {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-panel {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 48px;
    }

    .profile-page {
        width: min(100% - 20px, 1180px);
        padding-top: 10px;
    }

    .profile-hero-card,
    .profile-panel {
        padding: 16px;
    }

    .profile-details-grid,
    .profile-form,
    .wishlist-preview-grid {
        grid-template-columns: 1fr;
    }

    .profile-form .full-row {
        grid-column: auto;
    }

    .panel-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .profile-hero-top {
        align-items: flex-start;
    }

    .profile-avatar {
        width: 58px;
        height: 58px;
        font-size: 24px;
    }

    .profile-hero-details h2 {
        font-size: 21px;
    }

    .profile-links {
        grid-template-columns: 1fr;
    }

    .profile-link {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 12px;
    }

    .link-icon {
        width: 40px;
        height: 40px;
    }

    .order-header {
        flex-direction: column;
        gap: 8px;
    }

    .order-status {
        align-self: flex-start;
    }
}
