/* ======================================================================
   product_detail.css — Surface CSS for /store/products/<slug>
   Extracted from templates/store/product_detail.html inline <style>
   in Phase 1 of theme system build (2026-05-04).
   Theme tokens come from tokens.css. Body bg/color/font are inherited.
   ====================================================================== */

* { box-sizing: border-box; }

body { min-height: 100vh; margin: 0; }

        /* Header */
        .site-header {
            background-color: var(--bg-panel);
            padding: 15px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 1000;
            border-bottom: 1px solid var(--border-subtle);
        }

        .logo-container img {
            height: 40px;
            width: auto;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .back-link {
            color: var(--text-muted);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            transition: color 0.3s ease;
        }

        .back-link:hover {
            color: var(--accent-on-light);
        }

        .cart-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: transparent;
            border: 1px solid rgba(210, 153, 34, 0.3);
            border-radius: 6px;
            color: var(--accent-on-light);
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .cart-btn:hover {
            background: var(--accent-glow);
            border-color: rgba(210, 153, 34, 0.5);
            color: var(--accent-on-light);
        }

        .cart-count {
            background: linear-gradient(135deg, var(--accent) 0%, #9e6a03 100%);
            color: var(--text-on-accent);
            border-radius: 50%;
            padding: 2px 7px;
            font-size: 11px;
            font-weight: 700;
            min-width: 18px;
            text-align: center;
        }

        /* ===== NEW LAYOUT STRUCTURE ===== */
        .product-page-wrapper {
            display: flex;
            min-height: calc(100vh - 71px);
        }

        /* Main Content Area - flows adjacent to sidebar */
        .product-main-content {
            flex: 1;
            min-width: 0; /* Prevent flex overflow */
            padding: 40px 90px 16px 50px; /* Extra right padding for breathing room */
            max-width: calc(100% - 380px); /* Account for sidebar */
        }

        /* Inner container for content alignment */
        .content-inner {
            max-width: 900px;
            margin-left: auto; /* Push content toward sidebar */
        }

        /* Constrain text width for readability */
        .product-header {
            max-width: 720px;
        }

        /* Let long description, video and related products use full width */
        .product-long-description,
        .loom-video-container,
        .related-section {
            max-width: none;
        }

        /* Purchase Panel - sticky sidebar on desktop */
        .purchase-panel {
            position: sticky;
            top: 71px;
            width: 380px;
            height: calc(100vh - 71px);
            background: var(--bg-panel);
            border-left: 1px solid var(--border-subtle);
            padding: 30px 25px;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            flex-shrink: 0;
        }

        .purchase-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(210, 153, 34, 0.3), transparent);
        }

        /* Product Header in Main Content */
        .product-header {
            margin-bottom: 30px;
        }

        .product-category {
            color: var(--accent-on-light);
            font-size: 13px;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 8px;
            font-weight: 500;
        }

        .product-title {
            font-family: 'DM Sans', sans-serif;
            font-size: 36px;
            font-weight: 600;
            line-height: 1.2;
            letter-spacing: -0.5px;
            margin: 0;
        }

        /* Product Image */
        .product-image-container {
            position: relative;
            margin-bottom: 30px;
            border-radius: 12px;
            overflow: hidden;
            background: var(--bg-panel);
            border: 1px solid rgba(210, 153, 34, 0.1);
        }

        .product-image-container img {
            width: 100%;
            height: auto;
            display: block;
        }

        .product-image-placeholder {
            min-height: 350px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
        }

        .product-image-placeholder i {
            font-size: 72px;
            color: var(--border-strong);
        }

        .subscription-badge {
            position: absolute;
            top: 16px;
            left: 16px;
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: #fff;
            padding: 6px 14px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* Loom Video */
        .loom-video-container {
            margin-bottom: 30px;
            border-radius: 12px;
            overflow: hidden;
            border: 1px solid rgba(210, 153, 34, 0.1);
        }

        .loom-video-container iframe {
            width: 100%;
            aspect-ratio: 16/9;
            display: block;
        }

        /* Description Area */
        .product-description-section {
            margin-bottom: 40px;
        }

        .product-description {
            color: var(--text-muted);
            line-height: 1.85;
            font-size: 16px;
        }

        .product-long-description {
            line-height: 1.85;
        }

        .product-long-description h3,
        .product-long-description h4 {
            color: var(--accent-on-light);
            margin-top: 28px;
            margin-bottom: 12px;
            font-weight: 600;
        }

        .product-long-description h3 {
            font-size: 22px;
        }

        .product-long-description h4 {
            font-size: 18px;
        }

        .product-long-description ul,
        .product-long-description ol {
            margin-left: 20px;
            margin-bottom: 18px;
        }

        .product-long-description li {
            margin-bottom: 10px;
        }

        .product-long-description p {
            margin-bottom: 16px;
        }

        /* ===== PURCHASE PANEL COMPONENTS ===== */

        /* Panel Header */
        .panel-category {
            color: var(--accent-on-light);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 6px;
            font-weight: 500;
        }

        .panel-title {
            font-family: 'DM Sans', sans-serif;
            font-size: 22px;
            font-weight: 600;
            line-height: 1.25;
            letter-spacing: -0.3px;
            margin: 0 0 20px 0;
            color: var(--text-primary);
        }

        /* Panel Image */
        .panel-image-container {
            position: relative;
            margin-bottom: 24px;
            border-radius: 10px;
            overflow: hidden;
            background: var(--bg-base);
            border: 1px solid rgba(210, 153, 34, 0.1);
        }

        .panel-image-container img {
            width: 100%;
            height: auto;
            display: block;
        }

        .panel-image-container .product-image-placeholder {
            min-height: 200px;
        }

        .panel-image-container .subscription-badge {
            top: 12px;
            left: 12px;
            padding: 5px 10px;
            font-size: 11px;
        }

        /* Mobile-only elements */
        .mobile-only {
            display: none;
        }

        /* Price Section */
        .price-section {
            margin-bottom: 24px;
        }

        .price-row {
            display: flex;
            align-items: baseline;
            gap: 12px;
            flex-wrap: wrap;
        }

        .price-current {
            font-size: 38px;
            font-weight: 700;
            color: var(--accent-on-light);
            line-height: 1;
        }

        .price-original {
            font-size: 20px;
            color: var(--text-faint);
            text-decoration: line-through;
        }

        .price-savings {
            background: linear-gradient(135deg, var(--danger) 0%, var(--danger) 100%);
            color: #fff;
            padding: 4px 10px;
            border-radius: 4px;
            font-size: 13px;
            font-weight: 600;
        }

        /* Features List */
        .features-list {
            list-style: none;
            padding: 0;
            margin: 0 0 24px 0;
        }

        .features-list li {
            padding: 8px 0;
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .features-list i {
            color: var(--accent-on-light);
            font-size: 16px;
        }

        .features-list .requirement-item i {
            color: #f59e0b;
        }

        .features-list .requirement-note {
            font-size: 11px;
            color: var(--text-faint);
            font-weight: normal;
        }

        /* Add to Cart Button */
        .btn-add-to-cart {
            width: 100%;
            padding: 16px 24px;
            background: linear-gradient(135deg, var(--accent) 0%, #9e6a03 100%);
            color: var(--text-on-accent);
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 15px rgba(210, 153, 34, 0.25);
        }

        .btn-add-to-cart:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(210, 153, 34, 0.35);
            background: linear-gradient(135deg, #e0a82e 0%, #b8780a 100%);
        }

        .btn-add-to-cart:active {
            transform: translateY(0);
        }

        .btn-add-to-cart:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-add-to-cart i {
            font-size: 18px;
        }

        /* Panel spacer to push content up */
        .panel-spacer {
            flex: 1;
        }

        /* ===== MOBILE STICKY BAR ===== */
        .mobile-purchase-bar {
            display: none;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-panel);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid var(--border-subtle);
            padding: 16px 20px;
            z-index: 999;
            box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
        }

        .mobile-purchase-bar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(210, 153, 34, 0.4), transparent);
        }

        .mobile-bar-content {
            display: flex;
            align-items: center;
            gap: 16px;
            max-width: 600px;
            margin: 0 auto;
        }

        .mobile-price-info {
            flex-shrink: 0;
        }

        .mobile-price-current {
            font-size: 24px;
            font-weight: 700;
            color: var(--accent-on-light);
            line-height: 1;
        }

        .mobile-price-original {
            font-size: 13px;
            color: var(--text-faint);
            text-decoration: line-through;
            margin-top: 2px;
        }

        .mobile-bar-content .btn-add-to-cart {
            flex: 1;
            padding: 14px 20px;
            font-size: 15px;
        }

        /* ===== RELATED PRODUCTS CAROUSEL ===== */
        .related-section {
            margin-top: 60px;
            padding-top: 40px;
            border-top: 1px solid var(--border-subtle);
            position: relative;
        }

        .related-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .related-title {
            font-size: 22px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }

        .carousel-nav {
            display: flex;
            gap: 8px;
        }

        .carousel-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--bg-panel);
            border: 1px solid var(--border-subtle);
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .carousel-btn:hover:not(:disabled) {
            background: var(--accent);
            border-color: var(--accent-on-light);
            color: var(--text-on-accent);
        }

        .carousel-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .carousel-btn i {
            font-size: 18px;
        }

        .carousel-container {
            position: relative;
            overflow: hidden;
        }

        .carousel-track {
            display: flex;
            gap: 16px;
            overflow-x: auto;
            scroll-behavior: smooth;
            scrollbar-width: none;
            -ms-overflow-style: none;
            padding: 4px 0 16px 0;
        }

        .carousel-track::-webkit-scrollbar {
            display: none;
        }

        /* Fade edges to indicate more content */
        .carousel-container::after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 80px;
            height: 100%;
            background: linear-gradient(90deg, transparent, var(--bg-base));
            pointer-events: none;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .carousel-container.at-end::after {
            opacity: 0;
        }

        .carousel-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 80px;
            height: 100%;
            background: linear-gradient(270deg, transparent, var(--bg-base));
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1;
        }

        .carousel-container.scrolled::before {
            opacity: 1;
        }

        .related-product {
            flex: 0 0 180px;
            background: var(--bg-panel);
            border-radius: 10px;
            overflow: hidden;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            border: 1px solid rgba(210, 153, 34, 0.08);
            cursor: pointer;
        }

        .related-product:hover {
            transform: translateY(-6px);
            border-color: rgba(210, 153, 34, 0.3);
            box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(210, 153, 34, 0.1);
        }

        .related-product-image {
            width: 100%;
            height: 120px;
            object-fit: cover;
            background: var(--bg-elevated);
        }

        .related-product-info {
            padding: 14px;
        }

        .related-product-name {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
            line-height: 1.35;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            min-height: 38px;
        }

        .related-product-price {
            color: var(--accent-on-light);
            font-size: 17px;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .related-product-price .original-price {
            text-decoration: line-through;
            color: var(--text-faint);
            font-size: 13px;
            font-weight: 400;
            margin-right: 6px;
        }

        .related-product .btn-add-related {
            width: 100%;
            padding: 8px 12px;
            font-size: 13px;
            background: transparent;
            border: 1px solid rgba(210, 153, 34, 0.3);
            color: var(--accent-on-light);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .related-product .btn-add-related:hover {
            background: rgba(210, 153, 34, 0.15);
            border-color: var(--accent-on-light);
        }

        /* Mobile touch scrolling hint */
        @media (max-width: 900px) {
            .carousel-nav {
                display: none;
            }

            .related-product {
                flex: 0 0 165px;
            }

            .related-product-image {
                height: 110px;
            }

            .carousel-container::after {
                width: 50px;
            }

            .carousel-container::before {
                width: 50px;
            }
        }

        @media (max-width: 480px) {
            .related-product {
                flex: 0 0 150px;
            }

            .related-product-image {
                height: 100px;
            }

            .related-product-info {
                padding: 10px;
            }

            .related-product-name {
                font-size: 12px;
                min-height: 32px;
            }

            .related-product-price {
                font-size: 14px;
                margin-bottom: 8px;
            }

            .related-product .btn-add-related {
                padding: 6px 10px;
                font-size: 11px;
            }
        }

        /* ===== TOAST ===== */
        .toast-container {
            position: fixed;
            bottom: 100px;
            right: 20px;
            z-index: 1100;
        }

        .toast {
            background: var(--bg-panel);
            border: 1px solid rgba(210, 153, 34, 0.4);
            color: var(--text-primary);
            border-radius: 8px;
            padding: 12px 16px;
            margin-bottom: 8px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 1200px) {
            .product-main-content {
                padding: 40px 40px 120px 40px;
            }
        }

        @media (max-width: 1100px) {
            .purchase-panel {
                width: 340px;
                padding: 25px 20px;
            }

            .product-main-content {
                padding: 40px 50px 16px 30px;
                max-width: calc(100% - 340px);
            }

            .content-inner {
                margin-left: 0;
            }
        }

        @media (max-width: 900px) {
            /* Hide desktop panel, show mobile bar */
            .purchase-panel {
                display: none;
            }

            .mobile-purchase-bar {
                display: block;
            }

            /* Show mobile-only elements */
            .mobile-only {
                display: block;
            }

            .product-main-content {
                max-width: 100%;
                padding: 30px 20px 140px 20px;
            }

            .content-inner {
                margin-left: 0;
                max-width: 100%;
            }

            .product-title {
                font-size: 28px;
            }

            .toast-container {
                bottom: 120px;
                left: 20px;
                right: 20px;
            }
        }

        @media (max-width: 480px) {
            .product-main-content {
                padding: 20px 16px 140px 16px;
            }

            .product-title {
                font-size: 24px;
            }

            .mobile-bar-content {
                gap: 12px;
            }

            .mobile-price-current {
                font-size: 20px;
            }

            .mobile-bar-content .btn-add-to-cart {
                padding: 12px 16px;
                font-size: 14px;
            }
        }

        /* ===== CART DROPDOWN (unchanged) ===== */
        .cart-dropdown-container {
            position: relative;
            display: inline-block;
        }

        .cart-dropdown-content {
            display: none;
            position: fixed;
            right: 20px;
            top: 70px;
            background-color: var(--bg-panel);
            min-width: 320px;
            max-width: 380px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
            border-radius: 12px;
            z-index: 1001;
            border: 1px solid var(--border-subtle);
            overflow: hidden;
        }

        .cart-dropdown-container.hiding .cart-dropdown-content {
            display: none !important;
        }

        .cart-dropdown-content.show {
            display: block;
            animation: cartDropdownFadeIn 0.25s ease;
        }

        @keyframes cartDropdownFadeIn {
            from { opacity: 0; transform: translateY(-8px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes cartDropdownFadeOut {
            from { opacity: 1; transform: translateY(0) scale(1); }
            to { opacity: 0; transform: translateY(-8px) scale(0.97); }
        }

        .cart-dropdown-content.fade-out {
            animation: cartDropdownFadeOut 0.2s ease forwards;
        }

        @media (hover: hover) and (pointer: fine) {
            .cart-dropdown-container:hover .cart-dropdown-content {
                display: block;
                animation: cartDropdownFadeIn 0.25s ease;
            }
        }

        .cart-dropdown-header {
            padding: 15px 18px;
            border-bottom: 1px solid var(--border-subtle);
            font-weight: 600;
            font-size: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .cart-dropdown-count {
            color: var(--text-muted);
            font-weight: 400;
            font-size: 13px;
        }

        .cart-dropdown-items {
            max-height: 280px;
            overflow-y: auto;
            padding: 10px 0;
        }

        .cart-dropdown-empty {
            padding: 30px 18px;
            text-align: center;
            color: var(--text-faint);
            font-size: 14px;
        }

        .cart-dropdown-item {
            display: flex;
            align-items: center;
            padding: 12px 18px;
            gap: 12px;
            transition: background-color 0.2s ease;
        }

        .cart-dropdown-item:hover {
            background-color: rgba(210, 153, 34, 0.08);
        }

        .cart-dropdown-item-image {
            width: 50px;
            height: 50px;
            border-radius: 6px;
            object-fit: cover;
            background: var(--bg-elevated);
            flex-shrink: 0;
        }

        .cart-dropdown-item-image-placeholder {
            width: 50px;
            height: 50px;
            border-radius: 6px;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .cart-dropdown-item-image-placeholder i {
            color: var(--text-muted);
            font-size: 20px;
        }

        .cart-dropdown-item-info {
            flex: 1;
            min-width: 0;
        }

        .cart-dropdown-item-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 4px;
        }

        .cart-dropdown-item-details {
            font-size: 12px;
            color: var(--text-muted);
        }

        .cart-dropdown-item-price {
            font-weight: 600;
            color: var(--accent-on-light);
            font-size: 14px;
            white-space: nowrap;
        }

        .cart-dropdown-footer {
            padding: 15px 18px;
            border-top: 1px solid var(--border-subtle);
            background: rgba(0, 0, 0, 0.2);
        }

        .cart-dropdown-subtotal {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            font-size: 15px;
        }

        .cart-dropdown-subtotal span:last-child {
            font-weight: 700;
            color: var(--accent-on-light);
            font-size: 17px;
        }

        .cart-dropdown-checkout-btn {
            display: block;
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, var(--accent) 0%, #9e6a03 100%);
            color: var(--text-on-accent);
            text-align: center;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s ease;
            margin-bottom: 8px;
        }

        .cart-dropdown-checkout-btn:hover {
            background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
            color: var(--text-on-accent);
        }

        .cart-dropdown-continue-btn {
            display: block;
            width: 100%;
            padding: 10px;
            background: transparent;
            color: var(--text-muted);
            text-align: center;
            border: 1px solid var(--border-strong);
            border-radius: 8px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .cart-dropdown-continue-btn:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
            border-color: var(--text-muted);
        }

        @keyframes cartBounce {
            0%, 100% { transform: translateY(0); }
            25% { transform: translateY(-4px); }
            50% { transform: translateY(0); }
            75% { transform: translateY(-2px); }
        }

        .cart-btn.bounce {
            animation: cartBounce 0.4s ease;
        }

        @keyframes countPulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); }
            100% { transform: scale(1); }
        }

        .cart-count.pulse {
            animation: countPulse 0.3s ease;
        }

        /* Override footer margin on this page */
        .site-footer {
            margin-top: 0 !important;
        }
