/*
 * Frontend styles for Lovifys Account plugin.
 *
 * This stylesheet defines a compact, modern layout inspired by popular
 * e‑commerce mobile applications. It uses a mobile‑first approach with
 * responsive enhancements for larger screens. Colours are pulled from the
 * Lovifys brand palette (a pink gradient with soft neutrals) to build
 * trust and familiarity.
 */

:root {
    --lovifys-primary-gradient-start: #ff2d7a;
    --lovifys-primary-gradient-end: #ff5ca8;
    --lovifys-card-bg: #ffffff;
    --lovifys-bg: #f8f8fb;
    --lovifys-text: #333333;
    --lovifys-secondary-text: #666666;
    --lovifys-border: #e5e5e5;
    --lovifys-radius: 12px;
    --lovifys-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Hide default WooCommerce My Account navigation and titles */
body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-breadcrumb,
body.woocommerce-account .entry-title {
    display: none !important;
}

.lovifys-account {
    background: var(--lovifys-bg);
    padding: 1rem;
    min-height: 100vh;
    box-sizing: border-box;
}

.lovifys-account__inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card container */
.lovifys-account .card {
    background: var(--lovifys-card-bg);
    border-radius: var(--lovifys-radius);
    box-shadow: var(--lovifys-shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Profile section */
.lovifys-account__profile {
    align-items: center;
    text-align: center;
}
.lovifys-account__profile .profile-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--lovifys-primary-gradient-end);
}
.lovifys-account__profile h2 {
    margin: 0.5rem 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--lovifys-text);
}

/* Menu list */
.lovifys-account__menu .menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lovifys-account__menu .menu-item {
    border-bottom: 1px solid var(--lovifys-border);
}
.lovifys-account__menu .menu-item:last-child {
    border-bottom: none;
}
.lovifys-account__menu .account-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--lovifys-text);
    text-decoration: none;
    transition: background 0.2s ease;
}
.lovifys-account__menu .account-btn .icon {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--lovifys-primary-gradient-start);
    margin-right: 0.75rem;
}
.lovifys-account__menu .account-btn .label {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 500;
}
.lovifys-account__menu .account-btn .arrow {
    font-size: 0.75rem;
    color: var(--lovifys-secondary-text);
    margin-left: 0.5rem;
}
.lovifys-account__menu .menu-item.current .account-btn {
    background: linear-gradient(90deg, var(--lovifys-primary-gradient-start), var(--lovifys-primary-gradient-end));
    color: #fff;
    border-radius: var(--lovifys-radius);
    padding-left: 0.75rem;
}
.lovifys-account__menu .menu-item.current .icon,
.lovifys-account__menu .menu-item.current .arrow {
    color: #fff;
}
.lovifys-account__menu .account-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--lovifys-radius);
}

/* Support buttons */
.lovifys-account__support .support-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.lovifys-account__support .support-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--lovifys-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
}
.lovifys-account__support .support-btn .icon {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.lovifys-account__support .whatsapp {
    background: #e5f6ee;
    color: #128c7e;
}
.lovifys-account__support .whatsapp .icon {
    color: #128c7e;
}
.lovifys-account__support .email {
    background: #f5f5f5;
    color: var(--lovifys-text);
}
.lovifys-account__support .email .icon {
    color: var(--lovifys-primary-gradient-start);
}
.lovifys-account__support .callback {
    background: #fff0f6;
    color: #d6336c;
}
.lovifys-account__support .callback .icon {
    color: #d6336c;
}
.lovifys-account__support .support-btn:hover {
    filter: brightness(0.97);
}

/* Endpoint content */
.lovifys-account__endpoint {
    overflow-x: auto;
}
.lovifys-account__endpoint table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.lovifys-account__endpoint th,
.lovifys-account__endpoint td {
    padding: 0.5rem;
    border: 1px solid var(--lovifys-border);
    text-align: left;
}
.lovifys-account__endpoint th {
    background: #fafafa;
    font-weight: 600;
}
.lovifys-account__endpoint tr:nth-child(even) {
    background: #f9f9f9;
}

/* Legal footer */
.lovifys-account__footer {
    text-align: center;
    margin-top: 1rem;
}
.lovifys-account__footer .legal-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.lovifys-account__footer .legal-links a {
    color: var(--lovifys-secondary-text);
    text-decoration: none;
    font-size: 0.75rem;
}
.lovifys-account__footer .legal-links a:hover {
    text-decoration: underline;
}

/* Loader overlay (hidden by default) */
.lovifys-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lovifys-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}
.lovifys-loader-overlay .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--lovifys-primary-gradient-start);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: lovifys-spin 0.8s linear infinite;
}
@keyframes lovifys-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .lovifys-account__inner {
        max-width: 720px;
    }
    .lovifys-account__support .support-buttons {
        flex-direction: row;
        justify-content: space-between;
    }
    .lovifys-account__support .support-btn {
        flex: 1;
        margin-right: 0.5rem;
        text-align: center;
    }
    .lovifys-account__support .support-btn:last-child {
        margin-right: 0;
    }
}

/* Compact header shown only on WooCommerce account sub-pages */
.lovifys-account__subpage-head {
    padding: 0.75rem 1rem !important;
}
.lovifys-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--lovifys-primary-gradient-start);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
}
.lovifys-back-btn i {
    font-size: 0.8rem;
}

/* Make Font Awesome icons visible even if WoodMart/theme CSS conflicts */
.lovifys-account i[class*="fa-"],
.lovifys-account .fa-solid,
.lovifys-account .fa-regular,
.lovifys-account .fa-brands {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-style: normal !important;
    font-weight: 900 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.lovifys-account .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}


/* ===== v1.2 Professional compact dashboard header ===== */
.lovifys-account {
    padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom));
    background: #f6f7f9;
}
.lovifys-account__inner {
    max-width: 760px;
    gap: 0.75rem;
}
.lovifys-dashboard-header {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 0;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
    padding: 0.75rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: lovifys-rise 0.32s ease both;
}
.lovifys-dashboard-header .ldh-avatar img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e5e7eb;
}
.lovifys-dashboard-header .ldh-copy {
    min-width: 0;
    flex: 1;
}
.lovifys-dashboard-header h2 {
    margin: 0 0 0.16rem !important;
    font-size: 1.08rem !important;
    line-height: 1.22;
    color: #18181b;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.lovifys-dashboard-header p {
    margin: 0 !important;
    color: #6b7280;
    font-size: 0.84rem;
    line-height: 1.35;
    font-weight: 500;
}

/* Premium app menu refinements */
.lovifys-account .card {
    border: 1px solid #ededed;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.055);
    padding: 0.62rem;
}
.lovifys-account__menu .account-btn {
    min-height: 54px;
    padding: 0.56rem 0.38rem;
    border-radius: 12px;
}
.lovifys-account__menu .account-btn .label {
    font-size: 1.04rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.lovifys-account__menu .account-btn .icon {
    width: 34px;
    height: 34px;
    margin-right: 0.72rem;
    border-radius: 10px;
    color: #ff2d7a;
    background: #fff1f6;
    font-size: 1.05rem;
}
.lovifys-account__menu .account-btn .arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}
.lovifys-account__menu .account-btn:active,
.lovifys-account__support .support-btn:active,
.coh-card:active {
    transform: scale(0.985);
}
.lovifys-account__menu .account-btn,
.lovifys-account__support .support-btn,
.coh-card {
    transition: transform .14s ease, background .18s ease, box-shadow .18s ease;
}
@keyframes lovifys-rise {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Custom Order History UI ===== */
.lovifys-account__endpoint {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible;
}
.coh-container {
    padding-bottom: 86px;
}
.coh-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.05rem 0.65rem;
    background: #f6f7f9;
    scrollbar-width: none;
}
.coh-tabs::-webkit-scrollbar { display: none; }
.coh-tab {
    flex: 0 0 auto;
    border: 1px solid #e7e7e7;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 0.5rem 0.78rem;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(17,24,39,.035);
}
.coh-tab.active {
    border-color: #ff2d7a;
    color: #ff2d7a;
    background: #fff1f6;
}
.coh-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.coh-card {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 15px;
    box-shadow: 0 7px 18px rgba(17,24,39,.055);
    padding: 0.72rem;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto;
    gap: 0.72rem;
    align-items: center;
    cursor: pointer;
}
.coh-img img,
.coh-img-fallback {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.coh-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.coh-meta {
    margin-top: 0.26rem;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.32;
    font-weight: 600;
}
.coh-more {
    margin-top: 0.28rem;
    font-size: 0.75rem;
    color: #ff2d7a;
    font-weight: 800;
}
.coh-status {
    display: inline-flex;
    margin-top: 0.38rem;
    padding: 0.25rem 0.52rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}
.coh-pending { background: #fff7ed; color: #c2410c; }
.coh-success { background: #ecfdf5; color: #047857; }
.coh-cancel { background: #fef2f2; color: #b91c1c; }
.coh-default { background: #f3f4f6; color: #374151; }
.coh-right {
    min-width: 74px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.32rem;
}
.coh-price {
    font-size: 0.88rem;
    font-weight: 900;
    color: #111827;
    white-space: nowrap;
}
.coh-msg {
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 800;
    white-space: nowrap;
}
.coh-msg.success { color: #047857; }
.coh-msg.pending { color: #c2410c; }
.coh-arrow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
}
.coh-empty {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: 0 7px 18px rgba(17,24,39,.055);
}
.coh-empty i { font-size: 2rem; color: #ff2d7a; }
.coh-empty h3 { margin: .55rem 0 .25rem; font-size: 1.05rem; }
.coh-empty p { margin: 0 0 .75rem; color: #6b7280; }
.coh-shop-btn {
    display: inline-flex;
    padding: .58rem .88rem;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(90deg,#ff2d7a,#ff5ca8);
    text-decoration: none;
    font-weight: 900;
}
.coh-help {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(55px + env(safe-area-inset-bottom) + 8px);
    z-index: 9998;
    max-width: 740px;
    margin: 0 auto;
    background: #111827;
    color: #fff;
    border-radius: 14px;
    padding: 0.66rem 0.78rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    box-shadow: 0 12px 28px rgba(17,24,39,.22);
    font-size: 0.84rem;
    font-weight: 800;
}
.coh-help a {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 900;
}
.coh-help a i { font-size: .7rem; }

@media (max-width: 430px) {
    .lovifys-account { padding-left: 0.55rem; padding-right: 0.55rem; }
    .coh-card {
        grid-template-columns: 66px minmax(0,1fr) auto;
        gap: 0.58rem;
        padding: 0.62rem;
    }
    .coh-img img,
    .coh-img-fallback {
        width: 66px;
        height: 66px;
    }
    .coh-title { font-size: 0.92rem; }
    .coh-right { min-width: 62px; }
    .coh-price { font-size: 0.8rem; }
    .coh-help {
        left: 8px;
        right: 8px;
        font-size: 0.78rem;
        padding: 0.62rem 0.68rem;
    }
}
@media (min-width: 768px) {
    .lovifys-dashboard-header { border-radius: 16px; }
    .lovifys-account__inner { max-width: 780px; }
}


/* ===== v1.3 Custom Order Detail UI ===== */
.lod-container {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    padding-bottom: 86px;
}
.lod-hero {
    background: linear-gradient(135deg, #ffffff 0%, #fff3f8 100%);
    border: 1px solid #eeeeee;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(17,24,39,.06);
    padding: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}
.lod-chip {
    display: inline-flex;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    background: #fff1f6;
    color: #ff2d7a;
    font-size: 0.74rem;
    font-weight: 900;
    margin-bottom: 0.38rem;
}
.lod-hero h2 {
    margin: 0 !important;
    font-size: 1.16rem !important;
    line-height: 1.2;
    color: #111827;
    font-weight: 900;
}
.lod-hero p {
    margin: 0.22rem 0 0 !important;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
}
.lod-hero-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    background: #fff;
    color: #ff2d7a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 14px rgba(255,45,122,.12);
    font-size: 1.12rem;
}
.lod-card {
    background: #fff;
    border: 1px solid #ededed;
    border-radius: 16px;
    box-shadow: 0 7px 18px rgba(17,24,39,.055);
    padding: 0.8rem;
}
.lod-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    color: #111827;
    font-size: 0.96rem;
    font-weight: 900;
}
.lod-section-title i {
    color: #ff2d7a;
}
.lod-product {
    display: grid;
    grid-template-columns: 72px minmax(0,1fr) auto;
    align-items: center;
    gap: 0.68rem;
    padding: 0.64rem 0;
    border-top: 1px solid #f1f1f1;
}
.lod-section-title + .lod-product {
    border-top: 0;
    padding-top: 0;
}
.lod-product:last-child {
    padding-bottom: 0;
}
.lod-product-img img,
.lod-img-fallback {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.lod-product-info h3 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.25;
    color: #111827;
    font-weight: 900;
}
.lod-product-info p,
.lod-item-meta {
    margin: 0.24rem 0 0 !important;
    font-size: 0.76rem;
    color: #6b7280;
    font-weight: 700;
    line-height: 1.35;
}
.lod-product-price {
    font-size: 0.86rem;
    font-weight: 900;
    color: #111827;
    white-space: nowrap;
    text-align: right;
}
.lod-summary {
    display: flex;
    flex-direction: column;
}
.lod-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.52rem 0;
    border-top: 1px solid #f1f1f1;
    color: #6b7280;
    font-size: 0.86rem;
    font-weight: 700;
}
.lod-section-title + .lod-summary .lod-row:first-child {
    border-top: 0;
    padding-top: 0;
}
.lod-row strong {
    color: #111827;
    font-weight: 900;
    text-align: right;
}
.lod-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.lod-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.48rem 0.78rem;
    border-radius: 999px;
    background: #fff1f6;
    color: #ff2d7a;
    border: 1px solid #ffd1e1;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 900;
}
.lod-action-btn:hover {
    background: #ff2d7a;
    color: #fff;
}
.lod-address {
    margin: 0 !important;
    color: #374151;
    font-style: normal;
    font-size: 0.86rem;
    line-height: 1.55;
    font-weight: 700;
}
@media (max-width: 430px) {
    .lod-product {
        grid-template-columns: 62px minmax(0,1fr);
    }
    .lod-product-price {
        grid-column: 2;
        text-align: left;
        margin-top: -0.3rem;
    }
    .lod-product-img img,
    .lod-img-fallback {
        width: 62px;
        height: 62px;
    }
    .lod-row {
        font-size: 0.82rem;
    }
}
