/* JA Courier - Public Styles - Jamaican Theme */

:root {
    --ccms-green: #009B3A;
    --ccms-green-dark: #007A2E;
    --ccms-gold: #FFD100;
    --ccms-gold-dark: #E6BC00;
    --ccms-black: #000000;
}

.ccms-public-box {
    max-width: 640px;
    margin: 40px auto;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-top: 4px solid var(--ccms-green);
}

.ccms-track-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ccms-track-form input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
}
.ccms-track-form input:focus {
    border-color: var(--ccms-green);
    outline: none;
}
.ccms-track-form button,
.ccms-btn-calc {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--ccms-green), var(--ccms-green-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ccms-track-form button:hover,
.ccms-btn-calc:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,155,58,0.4);
}

.ccms-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.ccms-calc-grid .field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.ccms-calc-grid .field input,
.ccms-calc-grid .field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
}

/* Customer Dashboard */
.ccms-customer-wrap {
    display: flex;
    min-height: 70vh;
    background: #f5f7f0;
    border-radius: 16px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}
.ccms-cust-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--ccms-sidebar, #0a1f0a), #000000);
    color: #fff;
    padding: 24px 16px;
    border-right: none;
    position: relative;
    transition: transform 0.25s ease, visibility 0.25s;
    contain: layout style;
}
/* Sperm-head lifeline – thin line, faded bulbous yellow head, fading tip, 4.5s */
.ccms-cust-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 38%;
    background: linear-gradient(
        180deg,
        rgba(255, 209, 0, 0.95) 0%,
        rgba(255, 209, 0, 0.75) 10%,
        #009B3A 26%,
        rgba(0, 155, 58, 0.75) 50%,
        rgba(0, 155, 58, 0.35) 72%,
        rgba(255, 209, 0, 0.12) 88%,
        transparent 100%
    );
    border-radius: 60% 60% 40% 40% / 14% 14% 60% 60%;
    box-shadow:
        0 0 6px 2px rgba(255, 209, 0, 0.45),
        0 0 12px 3px rgba(0, 155, 58, 0.3);
    animation: ccms-lifeline-crawl var(--ccms-glow-speed, 4.5s) ease-in-out infinite alternate;
    will-change: transform, opacity;
    z-index: 10;
    pointer-events: none;
}
@keyframes ccms-lifeline-crawl {
    0%   { transform: translateY(0); opacity: 0.88; }
    50%  { transform: translateY(155%); opacity: 1; }
    100% { transform: translateY(165%); opacity: 0.88; }
}
@media (prefers-reduced-motion: reduce) {
    .ccms-sidebar::after,
    .ccms-cust-sidebar::after {
        animation: none !important;
        height: 100% !important;
        transform: none !important;
        background: linear-gradient(180deg, #009B3A, #FFD100) !important;
        will-change: auto;
        box-shadow: 0 0 10px 2px rgba(255, 209, 0, 0.5);
    }
}
.ccms-cust-logo {
    text-align: center;
    width: 100%;
    padding: 4px 0 8px;
}
.ccms-cust-logo img {
    max-height: 110px;
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    margin: 0 auto 12px;
    border: 2px solid var(--ccms-gold);
    display: block;
}
.ccms-cust-user {
    text-align: center;
    margin-bottom: 24px;
}
.ccms-cust-user img {
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid var(--ccms-gold);
}
.ccms-cust-sidebar nav a {
    display: block;
    padding: 12px 16px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 500;
}
.ccms-cust-sidebar nav a:hover,
.ccms-cust-sidebar nav a.active {
    background: linear-gradient(90deg, var(--ccms-green), #00c853);
    color: #fff;
}
.ccms-cust-main {
    flex: 1;
    padding: 32px;
    min-width: 0;
}
.ccms-cust-main h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    border-left: 4px solid var(--ccms-gold);
    padding-left: 12px;
}
.ccms-cust-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}
.stat-card {
    padding: 18px;
    border-radius: 14px;
    color: #fff;
}
.stat-card span { display: block; font-size: 0.85rem; opacity: 0.9; }
.stat-card strong { font-size: 1.6rem; }
.stat-card.blue { background: linear-gradient(135deg, #009B3A, #007A2E); }
.stat-card.green { background: linear-gradient(135deg, #FFD100, #E6BC00); color: #000; }
.stat-card.orange { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.stat-card.pink { background: linear-gradient(135deg, #1a1a1a, #000); }

.ccms-cust-panel {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-top: 3px solid var(--ccms-green);
}
.ccms-cust-panel h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}
.ccms-cust-panel .empty {
    color: #64748b;
}

.ccms-map {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    border: 2px solid var(--ccms-green);
    margin-top: 16px;
}

/* Mobile menu toggle */
.ccms-cust-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--ccms-green), var(--ccms-green-dark, #007A2E));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 12px;
}
.ccms-cust-menu-btn svg { width: 20px; height: 20px; }
.ccms-cust-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 90;
}
.ccms-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ccms-table-scroll table {
    min-width: 520px;
    width: 100%;
}

@media (max-width: 992px) {
    .ccms-cust-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ccms-customer-wrap {
        flex-direction: column;
        border-radius: 0;
        min-height: 100vh;
    }
    .ccms-cust-menu-btn,
    .ccms-cust-backdrop { display: none !important; }
    .ccms-cust-sidebar {
        position: relative;
        width: 100%;
        min-height: 0;
        transform: none;
        visibility: visible;
        overflow: visible;
        box-shadow: none;
        border-right: none;
        border-bottom: 3px solid var(--ccms-gold);
        padding: 12px 10px 8px;
    }
    .ccms-cust-sidebar .ccms-cust-logo,
    .ccms-cust-sidebar .ccms-cust-user,
    .ccms-cust-sidebar .ccms-dash-footer { display: block; }
    .ccms-cust-sidebar nav.ccms-side-nav,
    .ccms-cust-sidebar nav {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .ccms-cust-sidebar nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        margin-bottom: 0;
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .ccms-cust-main {
        padding: 16px 14px 32px;
        width: 100%;
    }
    .ccms-cust-main h1 { font-size: 1.25rem; }
    .ccms-cust-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 16px 0;
    }
    .stat-card { padding: 14px; }
    .stat-card strong { font-size: 1.3rem; }
    .ccms-cust-panel {
        padding: 16px;
        border-radius: 12px;
    }
    .ccms-calc-grid { grid-template-columns: 1fr; }
    .ccms-map { height: 280px; min-height: 280px; }
    .ccms-track-form { flex-direction: column; }
    .ccms-track-form input { min-width: 0; width: 100%; }
    .ccms-track-form button,
    .ccms-btn-calc { width: 100%; }
}

@media (max-width: 420px) {
    .ccms-cust-stats { grid-template-columns: 1fr; }
}


/* Full-screen customer portal removed */


.ccms-notif-badge {
    position: absolute !important;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e11d48 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 18px !important;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
.ccms-notif-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: min(340px, 92vw);
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    color: #0f172a;
    border-radius: 12px;
    border: 2px solid #009B3A;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    z-index: 500;
    padding: 8px;
}
/* Full-screen notification overlay with blur */
.ccms-notif-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100100;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 24px;
    overflow-y: auto;
    pointer-events: auto;
    cursor: pointer;
}
.ccms-notif-overlay.is-open { display: flex !important; }
.ccms-notif-panel-modal {
    cursor: default;
    pointer-events: auto;
    width: 100%;
    max-width: 420px;
    max-height: min(70vh, 520px);
    background: #fff;
    color: #0f172a;
    border-radius: 16px;
    border: 2px solid #009B3A;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ccms-notif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0d1f0d;
    color: #FFD100;
    border-bottom: 2px solid #FFD100;
}
.ccms-notif-close {
    border: 0;
    background: transparent;
    color: #FFD100;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
}
.ccms-notif-list {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}
.ccms-notif-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background .15s;
}
.ccms-notif-item:hover { background: #f8fafc; }
.ccms-notif-item.unread { background: #f0fdf4; }
.ccms-notif-item strong { display: block; font-size: 0.9rem; }
.ccms-notif-item span { display: block; font-size: 0.82rem; color: #475569; margin-top: 2px; }
.ccms-notif-item small { display: block; font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }
.ccms-notif-empty { padding: 16px; text-align: center; color: #64748b; }

/* Gold coins + glitter burst from bottom */
.ccms-reward-burst {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
    display: none;
}
.ccms-reward-burst.is-active { display: block; }
.ccms-coin {
    position: absolute;
    bottom: -40px;
    font-size: 1.6rem;
    animation: ccms-coin-rise 2.4s ease-out forwards;
    opacity: 0;
}
.ccms-coin.glitter {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 6px gold);
}
@keyframes ccms-coin-rise {
    0% { transform: translateY(0) rotate(0deg) scale(0.6); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(720deg) scale(1.1); opacity: 0; }
}
.ccms-country-flag {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}


/* Faded top-right dashboard image */
.ccms-customer-wrap {
    position: relative;
}
.ccms-dash-bg-fade {
    position: absolute;
    top: 0;
    right: 0;
    width: min(480px, 55%);
    height: 260px;
    background-size: cover;
    background-position: center top;
    opacity: 0.16;
    pointer-events: none;
    z-index: 0;
    border-radius: 0 0 0 48px;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.9), transparent 95%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.9), transparent 95%);
}
.ccms-cust-main,
.ccms-cust-sidebar {
    position: relative;
    z-index: 1;
}




/* Stable customer dashboard layout — fits in theme page, no overlay */
.ccms-customer-wrap {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 1200px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 20px auto !important;
    z-index: 1 !important;
    overflow: visible !important;
    display: flex !important;
    background: #f5f7f0;
    border-radius: 12px;
}
.ccms-customer-wrap .ccms-cust-sidebar {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 240px;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
}
.ccms-customer-wrap .ccms-cust-main {
    flex: 1;
    height: auto !important;
    overflow: visible !important;
    padding: 16px 20px 28px;
}
body.ccms-portal-open #wpadminbar,
body.ccms-portal-open .site-header,
body.ccms-portal-open header,
body.ccms-portal-open footer,
body.ccms-portal-open .site-footer {
    display: block !important;
    visibility: visible !important;
}


/* ===== Faded top-right dashboard background ===== */
.ccms-dash-bg-fade {
    position: absolute;
    top: 0;
    right: 0;
    width: min(480px, 55%);
    height: 260px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
    border-radius: 0 0 0 48px;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.95), transparent 92%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.95), transparent 92%);
}
.ccms-main,
.ccms-cust-main,
.ccms-topbar,
.ccms-status-cards,
.ccms-panel,
.ccms-cust-panel {
    position: relative;
    z-index: 1;
}

/* ===== Mobile responsive layout (admin + customer) ===== */
@media (max-width: 960px) {
    .ccms-wrap,
    .ccms-customer-wrap {
        flex-direction: column !important;
        border-radius: 12px;
    }
    .ccms-sidebar,
    .ccms-cust-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 3px solid #FFD100 !important;
    }
    .ccms-sidebar::after,
    .ccms-cust-sidebar::after {
        display: block !important;
        top: auto !important;
        bottom: 0 !important;
        right: auto !important;
        left: 0 !important;
        width: 22% !important;
        height: 5px !important;
        animation-name: ccms-lifeline-crawl-h !important;
    }
    @keyframes ccms-lifeline-crawl-h {
        0%   { transform: translateX(0); }
        100% { transform: translateX(350%); }
    }
    .ccms-sidebar nav,
    .ccms-cust-sidebar nav,
    .ccms-side-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        padding: 8px 10px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ccms-sidebar nav a,
    .ccms-nav-item,
    .ccms-cust-sidebar nav a,
    .ccms-side-nav a {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    .ccms-main,
    .ccms-cust-main {
        width: 100% !important;
        padding: 14px 12px 24px !important;
    }
    .ccms-topbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .ccms-status-cards,
    .ccms-cust-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .ccms-dash-bg-fade {
        width: min(320px, 70%);
        height: 160px;
        opacity: 0.14;
    }
    .ccms-map,
    #ccms-admin-live-map,
    #ccms-cust-live-map {
        height: 260px !important;
        min-height: 260px !important;
    }
}
@media (max-width: 480px) {
    .ccms-status-cards,
    .ccms-cust-stats {
        grid-template-columns: 1fr !important;
    }
    .ccms-topbar h1 {
        font-size: 1.2rem !important;
    }
}


/* ===== Accessibility (customer) ===== */
.ccms-customer-wrap .ccms-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 12px 18px;
    background: #009B3A;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}
.ccms-customer-wrap .ccms-skip-link:focus {
    left: 0;
    outline: 3px solid #FFD100;
    outline-offset: 2px;
}
.ccms-tab:focus-visible,
.ccms-btn-calc:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid #FFD100 !important;
    outline-offset: 2px !important;
}


/* Wider customer dashboard body – less empty space */
.ccms-cust-main {
    flex: 1;
    min-width: 0;
    padding: 12px 12px 20px !important;
    max-width: none !important;
}
.ccms-customer-wrap {
    max-width: none !important;
}
.ccms-cust-panel, .ccms-customer-wrap .ccms-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Generic modal overlays (orders, loyalty, etc.) */
.ccms-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100050;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.ccms-modal-overlay.is-open { display: flex; }
.ccms-modal-panel {
    width: 100%;
    max-width: 480px;
    max-height: min(85vh, 640px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #009B3A;
}
.ccms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 8px;
}
.ccms-modal-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
}
.ccms-modal-body {
    padding: 16px 18px 20px;
    overflow-y: auto;
    flex: 1;
    color: #0f172a;
}
.ccms-order-modal-panel { max-width: 520px; }
.ccms-invoice-overlay {
    background: rgba(13, 71, 161, 0.55) !important;
}
.ccms-invoice-modal-panel {
    max-width: 720px;
    border-color: #1565c0 !important;
}
.ccms-detail-table th {
    width: 32%;
    color: #64748b;
    font-weight: 600;
    text-align: left;
    padding: 8px 6px;
    vertical-align: top;
}
.ccms-detail-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f1f5f9;
}

/* Reward congratulations popup */
.ccms-reward-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100060;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.ccms-reward-popup.is-open { display: flex; }
.ccms-reward-popup-inner {
    background: linear-gradient(160deg, #fffbeb 0%, #fff 40%, #fef3c7 100%);
    border: 3px solid #FFD100;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(255, 209, 0, 0.35), 0 8px 24px rgba(0,0,0,.2);
    animation: ccms-reward-pop 0.5s cubic-bezier(.2,1.2,.4,1);
}
@keyframes ccms-reward-pop {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.ccms-reward-popup-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}
.ccms-reward-popup-lead {
    color: #64748b;
    margin: 0 0 14px;
    font-size: 1rem;
}
.ccms-reward-popup-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    text-align: left;
}
.ccms-reward-popup-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #fde68a;
    font-size: 1.05rem;
}
.ccms-reward-ico { font-size: 1.4rem; }
.ccms-glitter-dot {
    filter: drop-shadow(0 0 4px gold);
}
