/* BCardz-Public Catalog CSS - Professional SaaS Styling */
/* ===== 360° View button colours: change them HERE (the button CSS below only uses these variables) ===== */
:root {
    --360-view-bg: #FFC107;
    --360-view-text: #212121;
    --360-view-border: #FFC107;
    --360-view-hover: #E0A800;
}

body {
    background-color: #f8f9fa;
    color: #333;
}
.max-w-1200 { max-width: 1200px; margin: 0 auto; }

/* Sticky Header */
header.navbar {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    border-bottom: 1px solid #eaeaea;
}

/* Category Navigation */
#category-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eaeaea;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#category-nav::-webkit-scrollbar { display: none; }

.dm-chip {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dm-chip:hover {
    background: #f1f3f5;
    border-color: #ccc;
}
.dm-chip.is-active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
.dm-chip-n {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem;
}
.dm-chip.is-active .dm-chip-n {
    background: rgba(255,255,255,0.2);
}

/* Category Section */
.dm-cat-head {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eaeaea;
}
.dm-cat-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin: 0;
}
.dm-meta .dm-n {
    font-size: 0.9rem;
    color: #777;
}

/* Product Grid */
.dm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}
@media (min-width: 768px) {
    .dm-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 24px;
    }
}

/* Product Card */
.dm-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.dm-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.dm-media {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: none;
    padding: 0;
    background: #f8f9fa;
}
.dm-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dm-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.dm-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1.3;
}
.dm-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.4;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dm-priceblock {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: auto;
}
.dm-price {
    font-weight: 600;
    color: var(--bcardz-primary, #0d6efd);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.2;
}
.dm-add-btn {
    background: #fff;
    color: var(--bcardz-primary, #0d6efd);
    border: 1px solid var(--bcardz-primary, #0d6efd);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}.dm-add-btn:hover {
    background: #e9ecef;
}
.dm-add-btn.is-selected {
    background: var(--bcardz-accent, #198754);
    color: #fff;
    border-color: var(--bcardz-accent, #198754);
}

/* Modals */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Skeleton Loaders */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}
@keyframes shine {
    to { background-position-x: -200%; }
}

/* Protected Footer */
.protected-footer {
    border-top: 1px solid #eaeaea;
    margin-top: 20px;
    padding-top: 20px;
}

/* Product Image Navigation */
.product-image-viewer {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Product popup: the image frame takes the popup's own top corner radius (.modal-content, 12px) and clips the slides and
   images to it (Bootstrap's .carousel-inner already has overflow: hidden). Bottom corners stay square where the frame meets the
   details section. The image no longer needs its own smaller radius, so its white frame can't show outside the corners. */
#productCarousel .carousel-inner {
    border-radius: 12px 12px 0 0;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.image-nav:hover {
    background: rgba(0,0,0,0.8);
    color: #fff;
}

.image-nav-prev {
    left: 12px;
}

.image-nav-next {
    right: 12px;
}

@media (max-width: 767px) {
    .image-nav-prev { left: 6px; }
    .image-nav-next { right: 6px; }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 50% 50%;
    }
}
@media (min-width: 992px) {
    .footer-grid {
        grid-template-columns: 30% 30% 40%;
    }
}

.footer-map-wrapper {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

@media (min-width: 768px) and (max-width: 991px) {
    .footer-col-location {
        grid-column: 1 / -1;
    }
}

/* Footer Styles */
#main-footer.footer-light {
    background-color: #ffffff;
    color: #111827;
    border-top: 1px solid #e5e7eb;
}
#main-footer.footer-light .footer-heading {
    color: #64748b !important;
}
#main-footer.footer-light .footer-label {
    color: #64748b !important;
}
#main-footer.footer-light .footer-icon {
    color: #64748b !important;
}
#main-footer.footer-light .footer-link,
#main-footer.footer-light #footer-address {
    color: #111827 !important;
}
#main-footer.footer-light .footer-btn {
    border-color: #e5e7eb;
    color: #111827;
    background: #f8fafc;
}
#main-footer.footer-light .footer-btn:hover {
    background: #f1f5f9;
}
#main-footer.footer-light .footer-social-link {
    background: #f1f5f9;
    color: #64748b;
}
#main-footer.footer-light .footer-social-link:hover {
    background: #e2e8f0;
    color: #111827;
}
#main-footer.footer-light .footer-divider {
    color: #e5e7eb;
}

#main-footer.footer-dark {
    background-color: #111827;
    color: #f8fafc;
}
#main-footer.footer-dark .footer-heading {
    color: #94a3b8 !important;
}
#main-footer.footer-dark .footer-label {
    color: #94a3b8 !important;
}
#main-footer.footer-dark .footer-icon {
    color: #94a3b8 !important;
}
#main-footer.footer-dark .footer-link,
#main-footer.footer-dark #footer-address {
    color: #f8fafc !important;
}
#main-footer.footer-dark .footer-btn {
    border-color: #334155;
    color: #f8fafc;
    background: rgba(255,255,255,0.05);
}
#main-footer.footer-dark .footer-btn:hover {
    background: rgba(255,255,255,0.1);
}
#main-footer.footer-dark .footer-social-link {
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
}
#main-footer.footer-dark .footer-social-link:hover {
    background: rgba(255,255,255,0.15);
    color: #f8fafc;
}
#main-footer.footer-dark .footer-divider {
    color: #334155;
}
#main-footer.footer-dark #contact-footer, #main-footer.footer-dark #social-footer {
    border-color: #263244 !important;
}
#main-footer.footer-light #contact-footer, #main-footer.footer-light #social-footer {
    border-color: #e5e7eb !important;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

/* ===== Offers + Testimonials =====
   Theme colours use the same --bcardz-* variables (with fallbacks) as the product cards.
   Only low-opacity tints depend on the theme, so a light accent colour can never make text unreadable. */

.snap-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 14px;
    scrollbar-width: none;            /* arrows (desktop) and swiping (phones) replace the scrollbar */
}
.snap-track::-webkit-scrollbar { display: none; }

/* --- Offers --- */
.offer-card {
    flex: 0 0 88%;
    flex: 0 0 min(88%, 560px);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg,
        rgba(var(--bcardz-primary-rgb, 13, 110, 253), 0.10),
        rgba(var(--bcardz-accent-rgb, 25, 135, 84), 0.12));
    border: 1px solid rgba(var(--bcardz-primary-rgb, 13, 110, 253), 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
/* One offer: a single centred card, not a full-width banner. margin:auto (not justify-content:center)
   so it can never push content off the left edge where it cannot be scrolled to. */
.offer-track.is-single .offer-card {
    flex: 0 0 min(100%, 640px);
    margin-inline: auto;
}
/* Offer pictures are banners that usually carry text, so they must never be cropped.
   Recommended upload size: 1200 x 500 px (12:5). Any other shape is letterboxed, not cut. */
.offer-media {
    aspect-ratio: 12 / 5;
    background: #f1f3f5;
    overflow: hidden;
}
.offer-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.offer-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    flex-grow: 1;
}
.offer-badge {
    background: #ffc107;
    color: #222;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    padding: 4px 12px;
    border-radius: 999px;
}
.offer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
    margin: 0;
    line-height: 1.3;
}
.offer-desc {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
.offer-end {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #b02a37;
}
.offer-cta {
    margin-top: auto;
}
/* A text-only offer sitting next to a taller picture card: centre the text instead of leaving a big empty box */
.offer-card:not(.has-media) .offer-body {
    justify-content: center;
}
.offer-card:not(.has-media) .offer-cta {
    margin-top: 6px;
}

/* --- Testimonials ---
   Fixed dark "reviews" band (does not depend on theme colours, so text contrast is always safe). */
.testi-band {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 28px 16px 12px;
    color: #fff;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 193, 7, 0.22), transparent 42%),
        radial-gradient(circle at 92% 85%, rgba(99, 102, 241, 0.40), transparent 45%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
    box-shadow: 0 12px 28px rgba(30, 27, 75, 0.25);
}
/* Big decorative quote mark */
.testi-band::before {
    content: "\201C";
    position: absolute;
    top: -34px;
    left: 14px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 190px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.testi-head {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
}
.testi-stars {
    color: #ffc107;
    font-size: 1.35rem;
    letter-spacing: 4px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.testi-title {
    margin: 4px 0 4px;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}
.testi-sub {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
}
.testi-track {
    --testi-h: 240px;                 /* every screenshot gets the same height; width follows its own shape */
    position: relative;
    padding-bottom: 16px;
    align-items: flex-start;
}
@media (min-width: 768px) {
    .testi-track { --testi-h: 300px; }
}
/* Few screenshots: centre them. Auto margins centre only when there is spare room and collapse to 0
   when the row overflows, so the first card can never be pushed off the left edge (justify-content:center would). */
.testi-track.is-few > .testi-card:first-child { margin-left: auto; }
.testi-track.is-few > .testi-card:last-child  { margin-right: auto; }
@media (min-width: 768px) {
    .testi-band {
        padding: 36px 68px 16px;      /* side gutters hold the arrows */
    }
    .testi-title {
        font-size: 1.9rem;
    }
}
.testi-card {
    flex: 0 0 auto;                   /* size to the picture, never a fixed box */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    scroll-snap-align: center;
}
.testi-media {
    display: block;
    width: auto;
    padding: 0;
    border: 5px solid #fff;
    border-radius: 18px;
    overflow: hidden;
    background: #f1f3f5;
    cursor: zoom-in;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}
.testi-media:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}
/* Testimonials are screenshots / review cards full of text: show the WHOLE picture at its own shape
   (tall phone screenshot or wide card), scaled to a common max height. No cropping, no grey bars.
   max-width stays below the screen width so the next card peeks in and the row visibly scrolls.
   Tap opens the large lightbox. */
.testi-media img {
    display: block;
    width: auto;
    height: auto;
    max-height: var(--testi-h);
    max-width: min(74vw, 560px);
}
.testi-name {
    width: 0;                         /* a long name must not make the card wider than its picture */
    min-width: 100%;
    overflow-wrap: anywhere;
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}
.testi-name::before {
    content: "\2605\2605\2605\2605\2605";
    display: block;
    color: #ffc107;
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 2px;
}
/* Lightbox: wide enough to read a landscape review card (Bootstrap's default dialog is only 500px) */
#testimonial-modal { --bs-modal-width: 880px; }
.testi-zoom {
    display: block;
    margin: 0 auto;
    width: auto;
    max-width: 100%;
    max-height: 80vh;
}

/* --- Previous / Next arrows (created by initSlider in site.js) --- */
.snap-arrow {
    display: none;                    /* phones swipe; arrows appear from 768px */
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #222;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s, opacity 0.15s;
}
.snap-arrow:hover:not(:disabled) { transform: scale(1.08); }
.snap-arrow:focus-visible { outline: 3px solid #ffc107; outline-offset: 2px; }
.snap-arrow:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.snap-arrow.is-idle { display: none !important; }

/* Offers: arrows in the heading row, top right */
.offers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1rem;
}
.snap-arrows-inline { display: none; gap: 8px; }
.snap-arrows-inline.is-idle { display: none !important; }
.snap-arrows-inline .snap-arrow {
    width: 38px;
    height: 38px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Testimonials: arrows in the dark band's side gutters; JS sets `top` to the middle of the pictures */
.testi-arrow {
    position: absolute;
    transform: translateY(-50%);
    z-index: 2;
}
.testi-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); }
.testi-arrow-prev { left: 14px; }
.testi-arrow-next { right: 14px; }

@media (min-width: 768px) {
    .snap-arrow { display: inline-flex; }
    .snap-arrows-inline { display: flex; }
}

/* Product details (rich text from the admin editor) */
.product-details {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #212529;
    overflow-wrap: anywhere;
    max-height: 40vh;
    overflow-y: auto;
}
.product-details p { margin-bottom: 0.6rem; }
.product-details h2 { font-size: 1.2rem; font-weight: 700; margin: 0.8rem 0 0.4rem; }
.product-details h3 { font-size: 1.05rem; font-weight: 700; margin: 0.8rem 0 0.4rem; }
.product-details ul, .product-details ol { padding-left: 1.4rem; margin-bottom: 0.6rem; }
.product-details a { text-decoration: underline; }
.product-details > :last-child { margin-bottom: 0; }

/* 3D view button + full-screen viewer */
/* Product name on the left, the 360 button on the right, always on the same row (the name wraps inside its own space;
   the button never drops to a new line). */
.dm-name-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px 0;
}
.dm-name-row .dm-name { margin: 0; min-width: 0; flex: 1 1 auto; overflow-wrap: break-word; word-break: normal; }
/* Phones: the name gets the whole card width on its own row, with the button directly below it (side by side the name was
   squeezed into a few characters per line). Name -> button -> description -> price -> Interested. */
@media (max-width: 767.98px) {
    .dm-name-row {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 6px;
    }
    .dm-name-row .dm-name { flex: 0 0 auto; width: 100%; }
}
.dm-3d-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid var(--360-view-border);
    background: var(--360-view-bg);
    color: var(--360-view-text);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}
.dm-3d-btn:hover { background: var(--360-view-hover); border-color: var(--360-view-hover); color: var(--360-view-text); }
/* 3D viewer: the same full-screen presentation on every screen size. The overlay is the medium dark layer; .mv-model is the
   viewer sheet, white at 65% so the catalog stays faintly visible (the GLB itself is not touched and stays transparent).
   100dvh follows the visible height as mobile browser toolbars show/hide (100vh is the fallback). */
.mv-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overscroll-behavior: contain;
}
@supports (height: 100dvh) {
    .mv-overlay { width: 100dvw; height: 100dvh; }
}
.mv-model {
    width: 100%;
    height: 100%;
    border-radius: 0;
    --poster-color: transparent;
    background: rgba(255, 255, 255, 0.65);
}
/* the controls sit on the light sheet: dark disc for the close button, dark title; both keep safe-area offsets */
.mv-close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.mv-close:hover { background: rgba(0, 0, 0, 0.75); }
.mv-title {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    right: calc(max(12px, env(safe-area-inset-right)) + 60px);
    z-index: 2;
    color: #222;
    font-weight: 600;
    line-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
.mv-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #222;
    pointer-events: none;
}
.mv-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(0, 0, 0, 0.15);
    border-top-color: #222;
    border-radius: 50%;
    animation: mv-spin 0.9s linear infinite;
}
.mv-status.mv-error .mv-spinner { display: none; }
@keyframes mv-spin { to { transform: rotate(360deg); } }
