/* Profile */

/* Page shell */
.profile-page {
    max-width: 112rem;
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* Hero */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 3rem;
    background: var(--color-white);
    border: 1px solid rgba(var(--emerald-rgb), 0.14);
    border-radius: 10px;
    margin-bottom: 2.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.profile-hero-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--emerald);
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.profile-hero-info h1 {
    font-family: var(--font-serif);
    font-size: 2.1rem;
    font-weight: 500;
    color: var(--color-headings);
    margin-bottom: 0.3rem;
}

.profile-hero-email {
    color: var(--color-body);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.profile-hero-since {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin: 0;
}

/* Body grid */
.profile-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem;
}

/* Cards */
.profile-card {
    background: var(--color-white);
    border: 1px solid rgba(var(--emerald-rgb), 0.14);
    border-radius: 10px;
    padding: 2rem 2.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

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

.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(var(--emerald-rgb), 0.1);
}

.profile-card-header h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-headings);
    margin: 0;
}

/* Info grid */
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem 2rem;
}

.profile-info-item--full {
    grid-column: 1 / -1;
}

.profile-info-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
    font-family: var(--font-body);
}

.profile-info-value {
    display: block;
    font-size: 0.95rem;
    color: var(--color-body);
    font-family: var(--font-body);
}

.profile-empty {
    color: var(--color-text-muted);
    font-style: italic;
}

/* Security row */
.profile-security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-security-row p {
    margin: 0;
}

/* Buttons & links */
.profile-link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--emerald);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border: 1px solid var(--emerald);
    border-radius: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.profile-link-btn:hover {
    background: var(--emerald);
    border-color: var(--emerald);
    color: var(--color-white);
    text-decoration: none;
}


.profile-table-link {
    font-size: 0.8rem;
    color: var(--emerald);
    text-decoration: none;
    font-weight: 600;
}

.profile-table-link:hover {
    color: var(--emerald-dark);
    text-decoration: underline;
}

/* Empty state */
.profile-empty-orders {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-text-muted);
}

/* Orders table */
.profile-orders-table-wrap {
    overflow-x: auto;
}

.profile-orders-table {
    width: 100%;
    border-spacing: 0;
    font-family: var(--font-body);
    font-size: 0.88rem;
}

.profile-orders-table th {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(var(--emerald-rgb), 0.14);
    text-align: left;
    white-space: nowrap;
}

.profile-orders-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--beige-light);
    color: var(--color-body);
    vertical-align: middle;
}

.profile-orders-table tbody tr:last-child td {
    border-bottom: none;
}

.profile-orders-table tfoot td {
    border-top: 2px solid rgba(var(--emerald-rgb), 0.2);
    border-bottom: none;
    font-weight: 600;
    padding: 1rem;
}

.order-id {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--emerald);
    font-size: 0.85rem;
}


.order-total-highlight {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--emerald);
}

.order-ref {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    word-break: break-all;
}

/* Status badges */
.order-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-body);
}

.order-status--pending   { background: var(--color-message-warning-bg); color: #6b5d00; }
.order-status--paid      { background: var(--color-message-success-bg); color: var(--emerald); }
.order-status--shipped   { background: var(--color-message-info-bg); color: #1c5f96; }
.order-status--completed { background: var(--beige-light); color: var(--emerald); }
.order-status--cancelled { background: var(--color-message-error-bg); color: var(--color-message-error-text); }

.order-cancel-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    background: var(--color-message-warning-bg);
    color: var(--color-message-warning-text);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: middle;
}

.order-cancel-window {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.4rem;
    background: var(--color-white);
    border: 1px solid rgba(var(--emerald-rgb), 0.12);
    border-left: 3px solid var(--emerald-gold);
    margin-bottom: 1rem;
}

.order-cancel-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.order-cancel-label {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.order-cancel-timer {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--emerald);
    letter-spacing: 0.04em;
    line-height: 1;
}

.order-cancel-expired {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--gray-400);
}

.order-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--color-text-muted) !important;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none !important;
    transition: border-color 0.2s, color 0.2s;
}

.order-cancel-btn:hover {
    border-color: var(--color-danger);
    color: var(--color-danger) !important;
}

.order-cancel-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.order-resume-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: var(--emerald);
    border: 1px solid var(--emerald);
    color: #fff !important;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: background 0.2s, border-color 0.2s;
}

.order-resume-btn:hover {
    background: var(--emerald-dark);
    border-color: var(--emerald-dark);
    color: #fff !important;
}

/* Order detail item cards */
.od-card { padding: 1.4rem 1.6rem; }

.od-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--emerald);
    margin: 0 0 1.1rem;
}

.od-items {
    display: flex;
    flex-direction: column;
}

.od-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--beige-light);
}

.od-item:last-child {
    border-bottom: none;
}

.od-item-img-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(var(--emerald-rgb), 0.1);
    background: var(--beige-light);
}

.od-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.od-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
}

.od-item-info {
    flex: 1;
    min-width: 0;
}

.od-item-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-headings);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.od-item-meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.od-item-right {
    flex-shrink: 0;
    text-align: right;
}

.od-item-unit {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.od-item-subtotal {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-price);
    margin-top: 0.15rem;
}

.od-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(var(--emerald-rgb), 0.15);
}

.od-total-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.od-total-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-headings);
}

/* Form pages */
.profile-form-wrap {
    max-width: 700px;
    margin: 0 auto;
}

.profile-form-wrap--wide {
    max-width: 900px;
}

.profile-form-header {
    margin-bottom: 2rem;
}

.profile-form-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 4vw, 2.8rem);
    font-weight: 500;
    margin: 0.5rem 0 0;
    color: var(--color-headings);
}

.profile-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.82rem;
    color: var(--emerald);
    text-decoration: none;
    letter-spacing: 0.04em;
}

.profile-back-link::before {
    content: '';
    width: 6px;
    height: 6px;
    margin-right: 0.6rem;
    border-left: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
}

.profile-back-link:hover {
    color: var(--emerald-dark);
    text-decoration: underline;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.4rem 2rem;
    margin-bottom: 2rem;
}

.profile-form-group,
.profile-form-group .input {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

.profile-form-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    font-family: var(--font-body);
}

.profile-form-input,
.profile-form-group input,
.profile-form-group textarea,
.profile-form-group select {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-body);
    transition: border-color 0.2s ease;
    background: #fafafa;
}

.profile-form-input:focus,
.profile-form-group input:focus,
.profile-form-group textarea:focus {
    outline: none;
    border-color: var(--emerald);
    background: var(--color-white);
}

.profile-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(var(--emerald-rgb), 0.1);
}

.profile-save-btn {
    font-family: var(--font-display);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 48px;
    padding: 0.65rem 2rem;
    background: var(--emerald);
    color: var(--color-white);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.profile-save-btn:hover {
    background: var(--emerald-dark);
}

.profile-cancel-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.profile-cancel-btn:hover {
    color: var(--gray-800);
    text-decoration: none;
}

/* Status filter tabs */
.profile-status-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.profile-status-tab {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.55rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(var(--emerald-rgb), 0.25);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-status-tab:hover {
    border-color: var(--emerald);
    color: var(--emerald);
    text-decoration: none;
}

.profile-status-tab.active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: var(--color-white);
}

/* Order meta grid */
.order-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.order-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

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

/* Pagination */
.profile-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    padding: 1.6rem 0 0;
    margin: 0.25rem 0 0;
    border-top: 1px solid var(--beige-light);
    list-style: none;
}

.profile-pagination li {
    list-style: none;
}

.profile-pagination li a,
.profile-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.7rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-body);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.profile-pagination li a:hover,
.profile-pagination a:hover {
    background: rgba(var(--emerald-rgb), 0.08);
    border-color: rgba(var(--emerald-rgb), 0.18);
    color: var(--emerald);
    text-decoration: none;
}

.profile-pagination li.active a {
    background: var(--emerald);
    color: #fff;
    border-color: var(--emerald);
    font-weight: 600;
    pointer-events: none;
}

.profile-pagination li.prev a,
.profile-pagination li.next a {
    padding: 0 1rem;
    border: 1px solid rgba(var(--emerald-rgb), 0.22);
    color: var(--emerald);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

.profile-pagination li.prev a:hover,
.profile-pagination li.next a:hover {
    background: var(--emerald);
    border-color: var(--emerald);
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-page { padding: 1.25rem 1rem 3rem; }
    .profile-hero { flex-direction: column; text-align: center; padding: 1.5rem 1.25rem; gap: 1rem; margin-bottom: 1.25rem; }
    .profile-hero-info h1 { font-size: 1.9rem; }
    .profile-body { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .profile-card { padding: 1.25rem 1.25rem; }
    .profile-card--full { grid-column: 1; }
    .profile-card-header { margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
    .profile-info-grid { grid-template-columns: 1fr; }
    .profile-form-grid { grid-template-columns: 1fr; }
    .profile-form-group--full { grid-column: 1; }
    .profile-security-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .profile-orders-table th:nth-child(2),
    .profile-orders-table td:nth-child(2),
    .profile-orders-table th:nth-child(3),
    .profile-orders-table td:nth-child(3) { display: none; }
}


/* Wishlist page */
.wishlist-page.profile-page {
    max-width: 1200px;
    padding: 2rem 1rem 4rem;
}

.wishlist-back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--emerald);
    text-decoration: none;
    letter-spacing: 0.03em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s ease;
    margin-bottom: 1.2rem;
}
.wishlist-back-link:hover {
    border-bottom-color: rgba(var(--emerald-rgb), 0.4);
    text-decoration: none;
}

.wishlist-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.wishlist-title {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4.6vw, 3.2rem);
    font-weight: 500;
    color: var(--color-headings);
    margin: 0 0 1rem;
    line-height: 1.15;
}

.wishlist-actions-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.wishlist-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1.5px solid rgba(var(--emerald-rgb), 0.35);
    background: none;
    color: var(--emerald);
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.wishlist-share-btn:hover {
    border-color: var(--emerald);
    background: rgba(var(--emerald-rgb), 0.05);
}

/* X remove button */
.wishlist-remove-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    border-style: none;
    background: transparent;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease;
    box-sizing: border-box;
}
.wishlist-remove-btn:hover {
    transform: scale(1.1);
}
.wishlist-remove-btn svg {
    display: block;
    fill: none;
    stroke: rgba(var(--emerald-rgb), 0.55);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
    transition: stroke 0.18s ease;
}
.wishlist-remove-btn:hover svg {
    stroke: var(--emerald);
}

/* Size row */
.wishlist-size-row {
    margin-top: 0.5rem;
    margin-bottom: 0;
}


.wishlist-size-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 2.2rem 0.6rem 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1.5px solid rgba(var(--emerald-rgb), 0.35);
    border-radius: 6px;
    color: var(--emerald);
    background-color: var(--color-white);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 20 20'><path d='M5 7l5 5 5-5' stroke='%23284d40' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    text-align: center;
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s;
}
.wishlist-size-select:focus {
    border-color: var(--emerald);
}
/* Per-card Add to Bag */
.wishlist-atb-form {
    display: block;
}

.wishlist-add-to-bag-btn {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.6rem 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    color: var(--color-white);
    background: var(--emerald);
    border: 1px solid var(--emerald);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.32s cubic-bezier(0.32, 0.72, 0, 1), color 0.24s ease;
    white-space: nowrap;
}
.wishlist-add-to-bag-btn:hover {
    background: var(--color-white);
    color: var(--emerald);
    text-decoration: none;
}
.wishlist-add-to-bag-btn--sold-out {
    opacity: 0.4;
    cursor: not-allowed;
}
.wishlist-add-to-bag-btn--sold-out:hover {
    background: var(--emerald);
    color: var(--color-white);
}

.wishlist-guest-hint {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin: 0.5rem 0 1.5rem;
}
.wishlist-guest-hint a {
    color: var(--emerald, #2d6a4f);
    text-decoration: underline;
    text-underline-offset: 2px;
}
