/* =========================================================
   1. GLOBAL VARIABLES + BASE LAYOUT
========================================================= */

:root {
    --main-bg: #000;
    --footer-bg: #000;
    --accent: #003366;
    --accent-light: #22c55e;
}

html,
body {
    width: 100%;
    min-height: 100svh;

    margin: 0;
    padding: 0;

    overflow-x: hidden;

    background: var(--main-bg);
    color: #333;

    font-family: "Segoe UI", Arial, sans-serif;

    scroll-behavior: smooth;
}

main.main {
    flex: 1;

    display: flex;
    align-items: center;
}

.hidden {
    display: none !important;
}


/* =========================================================
   2. HEADER
========================================================= */

header.header {
    position: sticky;
    top: 0;

    z-index: 999;

    width: 100%;
    max-width: var(--max-width);

    margin: 0 auto;
    padding: 10px 15px 0;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: #000;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.4);
}


/* COMPANY LOGO */

header.header img.imglogo {
    max-height: 90px;
    height: auto;

    padding-right: 30px;

    object-fit: contain;

    background: transparent;

    cursor: pointer;

    transition:
        transform 0.2s ease;
}

header.header img.imglogo:hover {
    transform: scale(1.05);
}


/* AVATAR */

img.imgavatar {
    max-height: 90px;
}

#avatarVcard img {
    display: block;

    margin: 0 auto;

    aspect-ratio: 1 / 1;

    object-fit: cover;

    border: none;
    border-radius: 50%;

    background: none;

    box-shadow: none;
}


/* HEADER TEXT / ICONS */

header.header i,
header.header span,
header.header strong {
    color: #fff !important;
}


/* =========================================================
   3. STATS PANEL
========================================================= */

.stats-panel {
    position: absolute;

    top: 85px;
    left: 50%;

    z-index: 1000;

    width: calc(var(--max-width) * 0.42);

    padding: 15px 10px;

    display: none;

    transform: translateX(-50%);

    background: #fff;
    color: #000;

    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.1);
}

.stats-panel.is-open {
    display: block;
}

.stats-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 10px;

    color: var(--accent);

    font-size: 16px;
}

.stats-subtle {
    color: #777;

    font-size: 12px;
}

.stats-grid {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 12px;

    background: #f8f8f8;

    border-radius: 6px;

    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 26px;

    color: var(--accent-light);

    text-align: center;
}

.stat-label {
    flex: 1;

    margin-left: 8px;

    color: #333;

    font-size: 14px;

    text-align: left;
}

.stat-count {
    color: #000;

    font-size: 14px;
    font-weight: bold;
}


/* =========================================================
   4. MAIN PROMO IMAGE
========================================================= */

.image-container {
    width: 100%;
    max-width: var(--max-width);

    height: calc(100svh - 170px);

    margin: 0 auto;
    padding: 5px;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: #000;

    border-radius: 16px;
}

.image-container img.responsive-img {
    width: auto;
    height: calc(100svh - 180px);

    max-width: 100%;
    max-height: 100%;

    display: block;

    object-fit: contain;

    background: #000;

    border-radius: 16px;

    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.6),
        0 8px 18px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);

    transition:
        all 0.35s ease;
}


/* =========================================================
   5. FOOTER
========================================================= */

footer#footer {
    position: fixed;

    bottom: 0;
    left: 50%;

    z-index: 1000;

    width: 100%;
    max-width: var(--max-width);

    height: 60px;

    padding: 6px 10px;

    display: flex;
    align-items: center;

    transform: translateX(-50%);

    background: var(--footer-bg);
    color: #fff;

    border-top: 1px solid #222;
}

footer#footer i,
footer#footer .promo-text,
footer#footer .countdown-row {
    color: #fff !important;
}


/* =========================================================
   6. FOOTER BUSINESS STATUS
========================================================= */

#footer.business-open {
    background-color: #168c35 !important;

    transition:
        background-color 0.4s ease;

    cursor: pointer;
}

#footer.business-closed {
    background-color: #c62828 !important;

    transition:
        background-color 0.4s ease;

    cursor: pointer;
}


/* =========================================================
   7. COUNTDOWN TIMER
========================================================= */

footer#footer .countdown-box,
.countdown-box {
    flex: 1 1 auto;

    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.countdown-grid {
    width: 100%;
    max-width: 230px;

    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    column-gap: 6px;

    justify-content: center;
    align-items: center;

    box-sizing: border-box;
}


/* NUMBER BOXES */

.countdown-timer .countdown-cell {
    background: #fff;
    color: #000;

    border-radius: 6px;

    font-size:
        clamp(12px, 3vw, 16px);

    font-weight: bold;

    text-align: center;
}


/* SECONDS */

#seconds {
    background: #f2f2f2;

    opacity: 0.9;

    font-size:
        clamp(10px, 2.8vw, 14px);
}


/* LABEL ROW */

.countdown-text {
    width: 100%;
    max-width: 230px;

    margin-top: 3px;

    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    column-gap: 6px;

    justify-content: center;
    align-items: center;
}

.countdown-cell1 {
    color: #ccc;

    font-size:
        clamp(9px, 2.3vw, 11px);

    line-height: 1.2;

    text-align: center;
}


/* =========================================================
   8. EXPIRED PROMO NAME
========================================================= */

#expiredName {
    margin-top: 8px;

    overflow: hidden;

    color: #fff;

    font-size: 2em;
    font-weight: bold;

    line-height: 1.3;

    text-align: center;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   9. FOOTER WHATSAPP / SHARE / CALENDAR
========================================================= */

footer#footer .whatsappButton,
footer#footer .shareButton {
    position: relative;
    right: 0;
}

footer#footer .whatsappButton a {
    padding-right: 5px;

    color: #25D366;

    font-size: 50px;
}

footer#footer .shareButton i {
    color: #1da1f2;

    font-size: 28px;
}

.fa-whatsapp:before {
    padding-right: 20px;
}

.fa-share-alt:before {
    padding-left: 20px;
}

#showSharerBtn {
    font-size: 34px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

#showWhatsappBtn {
    font-size: 1.5em;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        color 0.2s ease;
}

.calendarButton i {
    color: #fff;

    font-size: 34px;

    line-height: 1;

    cursor: pointer;
}

.calendarButton i:hover {
    color: #f00;
}


/* =========================================================
   10. SOCIAL SHARE
========================================================= */

.social-share {
    position: relative;

    z-index: 50;

    display: flex;
    align-items: center;
}

.social-share-main {
    position: relative;

    z-index: 3;

    width: 44px;
    height: 44px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    color: #fff;

    border: 0;
    border-radius: 50%;

    font-size: 22px;

    cursor: pointer;
}


/* SLIDE-OUT TRAY */

.social-share-tray {
    position: absolute;

    left: 0 !important;
    bottom: 100% !important;

    z-index: 2;

    display: flex;
    align-items: center;

    gap: 8px;

    padding:
        6px
        10px
        6px
        48px;

    transform:
        translateY(-8px)
        translateX(-15px) !important;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    border-radius: 42px;

    white-space: nowrap;

    transition:
        transform 0.25s ease,
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.social-share.is-open .social-share-tray {
    transform:
        translateY(51px)
        translateX(0) !important;

    opacity: 1;
    visibility: visible;

    pointer-events: auto;
}


/* TRAY COLOUR */

footer.business-open .social-share-tray {
    background: #16833b;
}

footer.business-closed .social-share-tray {
    background: #c62828;
}

footer:not(.business-open):not(.business-closed)
.social-share-tray {
    background: #222;
}


/* SHARE OPTIONS */

.social-share-option {
    flex: 0 0 70px;

    width: 70px;
    height: 70px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(255, 255, 255, 0.16);

    color: #fff;

    border: 0;
    border-radius: 50%;

    font-size: 36px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.social-share-option:hover {
    background:
        rgba(255, 255, 255, 0.28);

    transform: scale(1.06);
}

.social-share-option:active {
    transform: scale(0.95);
}

#shareWhatsApp {
    font-size: 46px;
}


/* =========================================================
   11. ORDER FORM
========================================================= */

.order-wrap {
    max-width: 420px;

    margin: 30px auto;
    padding: 20px;

    background: #fff;

    border-radius: 10px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.15);
}

.order-title {
    margin-bottom: 15px;

    color: var(--accent);

    text-align: center;
}

.order-input {
    width: 100%;

    margin-bottom: 10px;
    padding: 8px;

    border: 1px solid #ccc;
    border-radius: 6px;
}

.btn-pay {
    width: 100%;

    padding: 12px 18px;

    background: #28a745;
    color: #fff;

    border: none;
    border-radius: 6px;

    font-size: 16px;

    cursor: pointer;

    transition:
        background-color 0.25s;
}

.btn-pay:hover {
    background: #16a34a;
}

.btn-order {
    width: 100%;

    padding: 12px 18px;

    background: #007bff;
    color: #fff;

    border: none;
    border-radius: 6px;

    font-size: 16px;

    cursor: pointer;

    transition:
        background-color 0.25s;
}

.btn-order:hover {
    background: #0069d9;
}


/* =========================================================
   12. MAP / ORDER OVERLAY
========================================================= */

#mapOverlay {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;
    justify-content: center;
    align-items: center;

    background:
        rgba(0, 0, 0, 0.85);
}

#mapOverlay.is-open {
    display: flex !important;
}

#mapSheet {
    width: 800px;
    max-width: 95%;
    max-height: 85vh;

    overflow: hidden;

    background: #000;

    border-radius: 10px;

    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.6);
}

#mapSheet iframe.map-frame {
    width: 100%;
    height: 70vh;

    display: block;

    border: none;
}

#closeMapBtn {
    position: absolute;

    top: 20px;
    right: 25px;

    z-index: 10000;

    width: 40px;
    height: 40px;

    background: #fff;
    color: #000;

    border: none;
    border-radius: 50%;

    font-size: 26px;
    font-weight: bold;

    line-height: 36px;

    text-align: center;

    cursor: pointer;

    transition:
        all 0.2s ease;
}

#closeMapBtn:hover {
    background: #ff4444;
    color: #fff;
}


/* =========================================================
   13. BUSINESS HOURS POPUP
========================================================= */

.business-hours-overlay {
    position: fixed;

    inset: 0;

    z-index: 99999;

    padding: 20px;

    display: none;
    align-items: center;
    justify-content: center;

    background:
        rgba(0, 0, 0, 0.55);
}

.business-hours-overlay.is-open {
    display: flex;
}

.business-hours-popup {
    position: relative;

    width: 100%;
    max-width: 390px;

    padding: 22px;

    background: #fff;

    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.30);
}

.business-hours-close {
    position: absolute;

    top: 10px;
    right: 12px;

    width: 38px;
    height: 38px;

    background: transparent;
    color: #555;

    border: none;

    font-size: 30px;

    line-height: 1;

    cursor: pointer;
}

.business-hours-popup-header {
    display: flex;
    align-items: center;

    gap: 14px;

    margin-bottom: 18px;
    padding-right: 35px;
}

.business-hours-popup-header > i {
    color: #333;

    font-size: 30px;
}

.business-hours-title {
    color: #222;

    font-size: 21px;
    font-weight: 700;
}

.business-hours-current {
    margin-top: 3px;

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0.5px;
}

.business-hours-current.is-open {
    color: #168c35;
}

.business-hours-current.is-closed {
    color: #c62828;
}

.business-hours-list {
    border-top: 1px solid #eee;
}

.business-hours-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 11px 5px;

    border-bottom: 1px solid #eee;

    font-size: 15px;
}

.business-hours-list-row.today {
    margin-left: -8px;
    margin-right: -8px;

    padding-left: 13px;
    padding-right: 13px;

    background: #f5f5f5;

    border-radius: 8px;

    font-weight: 700;
}

.business-hours-day {
    color: #333;
}

.business-hours-day small {
    display: inline-block;

    margin-left: 5px;

    color: #777;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
}

.business-hours-time {
    color: #333;

    font-weight: 600;

    white-space: nowrap;
}

.business-hours-time.closed {
    color: #c62828;
}


/* =========================================================
   14. WHATSAPP SHARE WARNING
========================================================= */

.wa-warning-overlay {
    position: fixed;

    inset: 0;

    z-index: 999999;

    padding: 20px;

    display: none;
    align-items: center;
    justify-content: center;

    background:
        rgba(0, 0, 0, 0.72);
}

.wa-warning-overlay.show {
    display: flex;
}

.wa-warning-box {
    width: 100%;
    max-width: 380px;

    padding: 25px 20px;

    background: #fff;

    border-radius: 18px;

    text-align: center;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.35);
}

.wa-warning-icon {
    margin-bottom: 8px;

    color: #25D366;

    font-size: 46px;
}

.wa-warning-box h2 {
    margin: 0 0 12px;

    color: #222;

    font-size: 23px;
}

.wa-warning-box p {
    color: #555;

    line-height: 1.5;
}


/* INSTRUCTION BOX */

.wa-important {
    margin: 17px 0;
    padding: 15px;

    background: #fff3cd;
    color: #664d03;

    border: 1px solid #ffe69c;
    border-radius: 10px;

    line-height: 1.5;
}

.wa-steps-title {
    display: block;

    margin-bottom: 14px;

    text-align: left;
}

.wa-steps {
    text-align: left;
}

.wa-step {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    margin-bottom: 13px;

    line-height: 1.4;
}

.wa-step:last-child {
    margin-bottom: 0;
}

.wa-step-number {
    flex: 0 0 27px;

    width: 27px;
    height: 27px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #25D366;
    color: #fff;

    border-radius: 50%;

    font-size: 14px;
    font-weight: 700;
}

.wa-step > span:last-child {
    padding-top: 3px;
}

.wa-small {
    font-size: 13px;
}


/* WARNING BUTTONS */

.wa-continue {
    width: 100%;

    margin-top: 8px;
    padding: 15px;

    background: #25D366;
    color: #fff;

    border: 0;
    border-radius: 10px;

    font-size: 17px;
    font-weight: 700;

    cursor: pointer;
}

.wa-continue:active {
    transform: scale(0.98);
}

.wa-cancel {
    width: 100%;

    margin-top: 8px;
    padding: 12px;

    background: transparent;
    color: #666;

    border: 0;

    font-size: 15px;

    cursor: pointer;
}


/* =========================================================
   15. PROMO IMAGE ADMIN LAYOUT
========================================================= */

.promo-image-section {
    width: 100%;
}

.promo-image-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    gap: 24px;

    align-items: start;

    margin-top: 18px;
    margin-bottom: 22px;
}

.promo-image-column {
    min-width: 0;
}

.promo-image-column .image-wrapper {
    width: 100%;

    margin: 0;
}

.promo-image-column .image-preview {
    display: block;

    width: 100%;
    max-width: 100%;
    height: auto;

    object-fit: contain;

    border-radius: 10px;
}

.promo-design-help {
    min-width: 0;

    margin: 0;

    text-align: left;
}

.promo-design-help > h3 {
    margin: 0 0 6px;
}

.promo-design-intro {
    margin: 0 0 15px;

    color: #ccc;

    font-size: 14px;

    line-height: 1.45;
}

.promo-design-card {
    display: flex;
    align-items: flex-start;

    gap: 14px;

    margin-bottom: 12px;
    padding: 16px;

    background:
        rgba(255, 255, 255, 0.06);

    border-radius: 10px;
}

.promo-design-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
}

.promo-design-content {
    flex: 1;

    min-width: 0;
}

.promo-design-content h4 {
    margin: 0 0 6px;

    color: #fff;
}

.promo-design-content p {
    margin: 0 0 12px;

    color: #ccc;

    font-size: 14px;

    line-height: 1.45;
}

.promo-design-btn {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    padding: 9px 14px;

    background: #0F62FE;
    color: #fff !important;

    border-radius: 7px;

    text-decoration: none;

    font-size: 13px;
    font-weight: 600;
}

.upload-form {
    width: 100%;

    margin-top: 10px;
}

.upload-form label {
    display: block;

    margin-bottom: 8px;

    font-weight: 600;
}

.upload-form input[type="file"] {
    width: 100%;

    box-sizing: border-box;
}

.btn-upload {
    margin-top: 12px;
}


/* =========================================================
   16. TABLET / MOBILE
========================================================= */

@media (max-width: 768px) {

    header.header,
    .image-container,
    footer#footer {
        width: 100%;
    }


    /* STATS */

    .stats-panel {
        left: 50%;

        width: 80%;

        transform:
            translateX(-50%);
    }


    /* HEADER LOGO */

    header.header img.imglogo {
        max-height: 90px;
    }


    /* FOOTER */

    footer#footer {
        box-sizing: border-box;

        gap: 4px;

        padding-left: 5px;
        padding-right: 5px;
    }

    footer#footer .promo-text {
        margin: 5px 0 3px !important;
        padding: 0 !important;

        line-height: 1 !important;
    }


    /* COUNTDOWN */

    footer#footer .countdown-box {
        flex: 1 1 0;

        width: 0;
        min-width: 0;

        margin: 0;
        padding: 0 2px;
    }

    footer#footer .countdown-grid,
    footer#footer .countdown-text {
        width: 100%;
        max-width: 220px;

        margin-left: auto;
        margin-right: auto;

        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        column-gap: 2px;
    }

    footer#footer .countdown-cell {
        width: auto;
        min-width: 0;

        padding: 2px 1px;

        font-size: 18px;

        line-height: 1.1;

        border-radius: 4px;
    }

    footer#footer #seconds {
        font-size: 16px;
    }

    /*
       Days / Hours / Minutes / Seconds
       Increased from the previous 7px/8px.
    */

    footer#footer .countdown-cell1 {
        min-width: 0;

        overflow: hidden;

        font-size: 10px;

        line-height: 1;

        white-space: nowrap;

        text-overflow: clip;
    }


    /* EXPIRED NAME */

    #expiredName {
        font-size: 1.6em;
    }


    /* WHATSAPP */

    footer#footer .whatsappButton {
        flex: 0 0 48px;

        width: 48px;

        margin: 0;
        padding: 0;

        text-align: center;
    }

    footer#footer .whatsappButton a {
        display: flex;
        align-items: center;
        justify-content: center;

        padding: 0;

        font-size: 42px !important;

        line-height: 1;

        text-decoration: none !important;

        border-bottom: none !important;
    }

    footer#footer .fa-whatsapp:before {
        padding-right: 0 !important;
    }


    /* SHARE */

    footer#footer .shareButton {
        flex: 0 0 48px;

        width: 48px;

        margin: 0;
        padding: 0;

        text-align: center;
    }

    footer#footer .shareButton i,
    footer#footer #showSharerBtn {
        font-size: 34px !important;

        line-height: 1;
    }

    footer#footer .fa-share-alt:before {
        padding-left: 0 !important;
    }

    footer#footer .shareButton a {
        text-decoration: none !important;

        border-bottom: none !important;
    }
}


/* =========================================================
   17. PROMO ADMIN MOBILE
========================================================= */

@media (max-width: 700px) {

    .promo-image-layout {
        grid-template-columns: 1fr;

        gap: 20px;
    }

    .promo-image-column,
    .promo-design-help {
        width: 100%;
    }
}


/* =========================================================
   18. SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    header.header img.imglogo {
        max-height: 60px;
    }

    #expiredName {
        font-size: 1.3em;
    }

    .btn-pay {
        font-size: 14px;
    }

    .business-hours-popup {
        max-width: 340px;

        padding: 20px 17px;
    }

    .business-hours-list-row {
        font-size: 14px;
    }
}

/* =========================================================
   ORDER THANK YOU OVERLAY
========================================================= */

.order-thankyou-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
}

.order-thankyou-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.order-thankyou-image {
    display: block;

    max-width: min(90vw, 600px);
    max-height: 85vh;

    width: auto;
    height: auto;

    object-fit: contain;

    transform: scale(0.94);
    transition: transform 0.6s ease;
}

.order-thankyou-overlay.is-visible
.order-thankyou-image {
    transform: scale(1);
}

/* =========================================================
   INSTALLED MYMOBI PWA
   Centre promo between header and footer
========================================================= */

@media (display-mode: standalone) {

    main.main {
        display: flex;
        align-items: center;
        justify-content: center;

        min-height: calc(100svh - 170px);
    }

    .image-container {
        height: calc(100svh - 240px);

        margin-top: auto;
        margin-bottom: auto;
    }

    .image-container img.responsive-img {
        height: calc(100svh - 250px);
    }

}