﻿/* ============================================================
   photocart-debug-fix.css
   Load AFTER FINAL_MOBILE_FIX.css - fixes layout/theme/wall-preview issues
   ============================================================ */

/* Remove phantom body padding-top */
body {
    padding-top: 0 !important;
}

/* Fabric canvas must keep inline height from Fabric.js */
#wallCanvas,
canvas.lower-canvas,
canvas.upper-canvas {
    height: revert !important;
    max-width: 100%;
}
#wallPreviewStage canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: unset !important;
}

.pc-controls {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    isolation: auto !important;
    z-index: auto !important;
}

.customizer-fab,
[data-customizer-fab] {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    isolation: isolate;
    transform: translateZ(0);
}

.navbar {
    position: sticky !important;
    top: 40px !important;
    z-index: 1000 !important;
    width: 100% !important;
}
.navbar.scrolled {
    isolation: isolate;
}

.premium-customizer,
.pc-header,
.pc-body,
.pc-sidebar,
.pc-panels-container,
.pc-canvas-area {
    position: relative !important;
    isolation: isolate;
}

/* Hide normal preview only when wall preview modal is closed */
body:not(.wall-preview-open) #wpmNormal {
    display: none !important;
}

#wallPreviewModal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 20000 !important;
    overflow: hidden !important;
    isolation: isolate;
    background: #0a0a0a !important;
    cursor: auto !important;
}

#wallPreviewModal *,
#wallPreviewModal button,
#wallPreviewModal [onclick] {
    cursor: pointer !important;
    pointer-events: all !important;
}

#wallPreviewModal > div:first-child {
    position: relative !important;
    z-index: 100 !important;
    background: rgba(10, 10, 10, 0.9) !important;
    pointer-events: all !important;
}

#wallPreviewModal[style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important;
}

#wallPreviewStage {
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    background: #111 !important;
    background-size: cover !important;
    background-position: center !important;
}

#wallPreviewStage canvas,
#wallCanvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

#proWallPreview,
#wpmNormal {
    flex: 1 1 auto;
}

/* â”€â”€ Mobile: navbar flex-column fix on small screens â”€â”€â”€â”€â”€â”€â”€â”€
   FINAL_MOBILE_FIX sets flex-direction:column on .navbar
   which stacks the hamburger above the logo. Fix ordering.   */
@media (max-width: 768px) {
    .navbar {
        padding: 0 10px !important;
        height: auto !important;
        min-height: 60px !important;
    }
    .nav-container {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) auto !important;
        align-items: center !important;
        column-gap: 8px !important;
    }
    .mobile-toggle {
        grid-column: 1 !important;
        justify-self: start !important;
        position: relative !important;
        z-index: 2 !important;
        margin: 0 !important;
    }
    .logo {
        grid-column: 2 !important;
        position: relative !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        justify-self: start !important;
        max-width: 100% !important;
        overflow: hidden !important;
        z-index: 1 !important;
    }
    .nav-actions {
        grid-column: 3 !important;
        justify-self: end !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .nav-actions .icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
}

/* Force navbar logo visibility across desktop + mobile */
.navbar .logo,
.navbar .logo img,
.navbar .logo-text {
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar .logo {
    display: inline-flex !important;
    align-items: center !important;
    z-index: 1300 !important;
}

.navbar .logo img {
    display: block !important;
    width: auto !important;
    object-fit: contain !important;
}

.navbar .logo-text {
    display: inline-block !important;
    white-space: nowrap !important;
}

@media (min-width: 769px) {
    .navbar .logo img {
        height: 56px !important;
    }
}

@media (max-width: 768px) {
    .navbar .logo img {
        height: 30px !important;
        max-width: 30px !important;
    }
    .navbar .logo-text {
        font-size: 0.88rem !important;
        max-width: 86px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media (max-width: 420px) {
    .navbar .logo-text {
        display: none !important;
    }
}

.footer .logo,
.footer .logo img,
.footer .logo-text {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Keep icons visible/aligned even under aggressive mobile overrides */
.nav-actions .icon-btn i.ph,
.mobile-bottom-nav .bottom-nav-item i.ph,
.mobile-toggle i.ph {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1em !important;
    height: 1em !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.nav-actions .icon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
}

.mobile-bottom-nav .bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    text-align: center !important;
}

.mobile-bottom-nav .bottom-nav-item i.ph {
    font-size: 1.45rem !important;
    margin: 0 !important;
}

/* â”€â”€ Mobile: wall preview header wraps on small screens â”€â”€â”€â”€â”€â”€ */
@media (max-width: 600px) {
    #wallPreviewModal > div:first-child {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px !important;
    }
    .wpm-room-btn {
        padding: 5px 10px !important;
        font-size: 0.65rem !important;
    }
}

/* Wall preview mobile fit: stable across iPhone/Android viewports */
@media (max-width: 991px) {
    #wallPreviewModal {
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 0 !important;
    }

    #wallPreviewModal > div:first-child {
        width: 100% !important;
        max-width: none !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        align-items: flex-start !important;
    }

    #wallPreviewModal .wpm-view-btn,
    #wallPreviewModal .wpm-room-btn {
        min-height: 34px !important;
        padding: 5px 10px !important;
        font-size: 0.62rem !important;
        letter-spacing: 0.04em !important;
    }

    #wallPreviewModal button[onclick="wpmDownload()"] {
        min-height: 34px !important;
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
    }

    #wallPreviewStage {
        max-width: none !important;
        width: 100% !important;
        min-height: calc(100dvh - 170px) !important;
        height: calc(100dvh - 170px) !important;
        flex: 0 0 auto !important;
    }

    #wallPreviewStage canvas,
    #wallCanvas {
        width: 100% !important;
        height: 100% !important;
    }
}

/* Product cards: normalize padding/heights so all cards align evenly */
.product-grid {
    align-items: stretch !important;
}
.product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 8px !important;
    border-radius: 10px !important;
}
.product-image {
    flex: 0 0 auto !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f6f6f6 !important;
    overflow: hidden !important;
}
.product-card .product-image img,
.product-card .product-image video,
.product-card .product-image .product-media {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #f6f6f6 !important;
}
.product-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 !important;
    justify-content: flex-start !important;
    padding: 8px 6px 6px !important;
}
.product-info h4 {
    margin: 0 !important;
    min-height: 2.1em !important;
    font-size: 0.84rem !important;
    line-height: 1.2 !important;
}
.product-info .price {
    margin: 0 !important;
    min-height: 1.1em !important;
    font-size: 0.78rem !important;
    line-height: 1.1 !important;
}
.product-info .btn-pc-primary,
.product-info .btn {
    margin-top: auto !important;
    width: 100% !important;
    min-height: 34px !important;
    font-size: 0.74rem !important;
    padding: 6px 8px !important;
}

@media (max-width: 768px) {
    .product-grid {
        gap: 8px !important;
    }

    .product-card {
        padding: 6px !important;
        border-radius: 9px !important;
    }

    .product-image {
        height: 132px !important;
        border-radius: 8px !important;
    }

    .product-info {
        padding: 6px 4px 4px !important;
        gap: 3px !important;
    }

    .product-info h4 {
        font-size: 0.76rem !important;
        min-height: 2em !important;
    }

    .product-info .price {
        font-size: 0.72rem !important;
        min-height: 1em !important;
    }

    .product-stars {
        font-size: 0.65rem !important;
        margin: 0 !important;
    }

    .product-info .btn-pc-primary,
    .product-info .btn {
        min-height: 30px !important;
        font-size: 0.7rem !important;
        padding: 4px 6px !important;
        border-radius: 7px !important;
    }
}

/* â”€â”€ Misc layout stability â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Prevent images from collapsing inside flex containers */
.scene-poster img,
.poster-item img,
.product-card img,
.trending-card img {
    height: auto;
    max-width: 100%;
    display: block;
}

/* Ensure hero scene doesn't get pushed by body padding */
.hero-scene,
.glass-marquee-section {
    margin-top: 0 !important;
}

/* Homepage hero and spacing cleanup */
.mobile-hero-slider {
    margin: 0 !important;
}

.mobile-hero-slider + .glass-marquee-section,
.glass-marquee-section + .mobile-hero-slider,
.mobile-hero-slider + .section,
.glass-marquee-section + .section {
    margin-top: 0 !important;
}

.section.category-showcase {
    padding-top: 20px !important;
    padding-bottom: 28px !important;
}

#acrylic-posters,
#paper-posters,
.custom-cta-v2,
#customizer {
    margin-top: 0 !important;
}

@media (min-width: 769px) {
    .mobile-hero-slider {
        display: block !important;
        min-height: clamp(500px, 62vh, 760px);
    }

    .mhs-track {
        width: 300% !important;
        height: clamp(500px, 62vh, 760px);
        will-change: transform;
    }

    .mhs-slide {
        width: 33.333333% !important;
        min-height: clamp(500px, 62vh, 760px) !important;
        padding: 72px 7vw 112px !important;
        justify-content: flex-start !important;
    }

    .mhs-content {
        max-width: min(560px, 44vw) !important;
        text-align: left !important;
        margin-left: 0 !important;
    }

    .mhs-title {
        font-size: clamp(3.2rem, 5vw, 5.2rem) !important;
        margin-bottom: 16px !important;
    }

    .mhs-subtitle {
        font-size: clamp(1.05rem, 1.4vw, 1.3rem) !important;
        max-width: 36rem;
    }

    .mhs-dots {
        bottom: 34px !important;
        justify-content: flex-start !important;
        padding-left: 7vw !important;
    }

    .mhs-stats {
        gap: 24px;
        justify-content: center;
        padding: 16px 7vw !important;
    }

    .glass-marquee-section {
        padding: 12px 0 !important;
    }

    .glass-marquee-card {
        flex: 0 0 350px !important;
        height: 520px !important;
    }

    .section {
        padding-top: 36px !important;
        padding-bottom: 36px !important;
    }

    #acrylic-posters,
    #paper-posters {
        padding-top: 52px !important;
        padding-bottom: 52px !important;
    }
}

@media (max-width: 768px) {
    .glass-marquee-card {
        flex: 0 0 185px !important;
        height: 260px !important;
    }
}

/* Remove extra blank gap before reviews section */
#customizer.studio-section {
    margin-bottom: 0 !important;
    padding-bottom: 28px !important;
}

#customizer .container,
#customizer .studio-layout {
    margin-bottom: 0 !important;
}

#customizer + .reviews-v2.section {
    margin-top: 0 !important;
    padding-top: 24px !important;
}

@media (max-width: 991px) {
    #customizer.studio-section {
        padding-bottom: 16px !important;
    }

    #customizer + .reviews-v2.section {
        padding-top: 12px !important;
    }
}

/* Cart drawer must sit ABOVE the floating bottom nav pill (1500) */
.cart-drawer {
    z-index: 2000 !important;
}
.cart-overlay {
    z-index: 1999 !important;
}

/* Hide floating pill nav when cart is open or Wall Preview modal is active,
   so it never overlaps modal/drawer content */
body.cart-open .mobile-bottom-nav,
body.wall-preview-open .mobile-bottom-nav {
    display: none !important;
}

/* Product mobile buy bar must never cover cart checkout actions. */
body.cart-open .mobile-sticky-buy {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-sticky-buy {
        display: grid !important;
        grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.6fr);
        gap: 8px 12px;
        align-items: center;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .mobile-sticky-buy .sticky-price,
    .mobile-sticky-buy .sticky-actions {
        min-width: 0;
    }

    .mobile-sticky-buy .sticky-actions {
        justify-content: flex-end;
        gap: 8px;
    }

    .mobile-sticky-buy .sticky-actions .btn-sm {
        min-width: 0;
        white-space: nowrap;
        padding: 10px 12px !important;
        font-size: 0.82rem !important;
    }

    .mobile-sticky-buy .sticky-trust-text {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 0;
        color: #6b7280;
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.25;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .cart-drawer {
        display: flex !important;
        flex-direction: column !important;
    }

    .cart-items {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    .cart-footer {
        flex: 0 0 auto !important;
        z-index: 2;
    }
}

@media (max-width: 380px) {
    .mobile-sticky-buy {
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 6px 8px;
    }

    .mobile-sticky-buy .sticky-actions .btn-pc-glass {
        display: none;
    }

    .mobile-sticky-buy .sticky-actions .btn-pc-primary {
        width: 100%;
    }
}

/* Fix overlapping transparency/labels: Make the floating nav pill solid white */
.mobile-bottom-nav {
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e1e1e1 !important;
}

/* Mobile marquee/coupon resilience: keep motion obvious and override older slow rules. */
@keyframes scrollLeftToRight {
    0% { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

@keyframes marquee-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

.marquee-pro {
    display: block !important;
    overflow: hidden !important;
}

.marquee-pro-content {
    display: inline-flex !important;
    align-items: center !important;
    width: max-content !important;
    min-width: max-content !important;
    white-space: nowrap !important;
    animation: marquee-scroll 32s linear infinite !important;
    -webkit-animation: marquee-scroll 32s linear infinite !important;
    animation-play-state: running !important;
    -webkit-animation-play-state: running !important;
    will-change: transform !important;
}

.coupon-marquee-copy {
    display: inline-block;
    padding-right: 48px;
}

.glass-marquee-section {
    display: block !important;
    overflow: hidden !important;
}

.glass-marquee-container {
    overflow: hidden !important;
}

.glass-marquee-track {
    display: flex !important;
    width: max-content !important;
    min-width: max-content !important;
    animation: scrollLeftToRight 90s linear infinite !important;
    -webkit-animation: scrollLeftToRight 90s linear infinite !important;
    animation-play-state: running !important;
    -webkit-animation-play-state: running !important;
    will-change: transform !important;
}

@media (max-width: 768px) {
    .marquee-pro {
        height: 34px !important;
        line-height: 34px !important;
    }

    .marquee-pro-content {
        animation-duration: 18s !important;
        -webkit-animation-duration: 18s !important;
    }

    .coupon-marquee-copy {
        padding-right: 32px;
    }

    .glass-marquee-section {
        padding: 8px 0 !important;
        min-height: 236px !important;
    }

    .glass-marquee-track {
        gap: 12px !important;
        animation-duration: 42s !important;
        -webkit-animation-duration: 42s !important;
    }

    .glass-marquee-card {
        flex: 0 0 160px !important;
        height: 220px !important;
    }
}

/* â”€â”€ WALL PREVIEW / AR VIEW OPEN: hide ALL page content behind the modal â”€â”€
   Sticky / fixed elements (customizer controls, nav, marquee) can
   escape z-index stacking contexts and bleed over the modal overlay.
   We now use display:none which is the most reliable way to clear the viewport. */
body.wall-preview-open > *:not(#wallPreviewModal):not(#arViewModal),
body.ar-view-open > *:not(#wallPreviewModal):not(#arViewModal) {
    display: none !important;
}
/* Keep the active modal itself fully visible */
body.wall-preview-open #wallPreviewModal,
body.ar-view-open #arViewModal {
    display: flex !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* Ensure both modals always render above everything */
#wallPreviewModal {
    z-index: 20000 !important;
}
#arViewModal {
    z-index: 20000 !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    background: #0a0a0a !important; /* Solid background to prevent bleed-through */
}

/* â”€â”€ FIX: Customizer footer overlapping with floating bottom nav pill â”€â”€
   The floating nav pill (.mobile-bottom-nav) sits at bottom:30px,
   height:70px, and the center FAB protrudes 30px above that.
   Total clearance needed from viewport bottom: ~130px.
   We add generous bottom-margin to the studio-footer so it
   never sits behind the nav pill, and increase the controls
   column bottom padding.                                        */
.studio-footer.pc-bottom {
    margin-bottom: 40px !important;
    padding-bottom: 20px !important;
}

/* Increase bottom padding on controls column to clear the nav pill */
.studio-controls-col,
.pc-controls {
    padding-bottom: 180px !important; /* Increased from 140px to fully clear the nav pill labels */
}

/* On desktop (wider screens), less padding is needed since
   the layout is side-by-side and footer isn't near bottom */
@media (min-width: 992px) {
    .studio-controls-col,
    .pc-controls {
        padding-bottom: 140px !important;
    }
    .studio-footer.pc-bottom {
        margin-bottom: 40px !important;
    }
}
