/* Mobile Wand Builder Styles */
/* Mobile-First Design - Base: 320px */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #1a802b;
    --primary-green-dark: #0d4016;
    --primary-green-light: #4dc275;
    --dark-grey: #212121;
    --med-grey: #757575;
    --light-grey: #999999;
    --white: #fff;
    --background: #f7f7f7;

    /* Wood tier accents (muted bronze / silver / gold) */
    --tier-1: #9a6b3f;
    --tier-1-soft: rgba(154, 107, 63, 0.1);
    --tier-2: #6e7580;
    --tier-2-soft: rgba(110, 117, 128, 0.1);
    --tier-3: #b08d2a;
    --tier-3-soft: rgba(176, 141, 42, 0.12);
    --tier-special: #1a802b;
    --tier-special-soft: rgba(26, 128, 43, 0.08);
    
    --nav-height: 60px;
    --tab-bar-height: 80px;
    --sale-top-banner-height: 0px;
    --modal-max-height: 85vh;
    
    --z-nav: 100;
    --z-tab-bar: 100;
    --z-gratisfaction: 150;
    --z-modal: 1000001;
    --z-loot-bag: 1000002;
    --z-confirm: 1000003;
}

html, body {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #333;
    background: var(--background);
    overflow: hidden;
}

body.mobile-builder {
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Off-screen but still in the accessibility tree / HTML source (not display:none) */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Top Navigation */
#mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: var(--z-nav);
}

/* Sitewide sale / promo strip under the nav */
.sale-top-banner {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: calc(var(--z-nav) - 1);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 44px 8px 14px;
    background: linear-gradient(90deg, #1a5c24 0%, #0d4016 55%, #8b1e1e 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.sale-top-banner.is-active {
    display: flex;
}

body.has-sale-top-banner {
    --sale-top-banner-height: 40px;
}

.sale-top-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px 12px;
    max-width: 100%;
}

.sale-top-banner__headline {
    letter-spacing: 0.01em;
}

.sale-top-banner__countdown:not(:empty)::before {
    content: '·';
    margin-right: 12px;
    opacity: 0.7;
    font-weight: 500;
}

.sale-top-banner__countdown {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    opacity: 0.95;
}

.sale-top-banner__close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
}

.sale-top-banner__close:active {
    background: rgba(255, 255, 255, 0.35);
}

.mobile-nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 15px;
}

.nav-logo img {
    height: 40px;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-button {
    min-width: 44px;
    height: 34px;
    border: none;
    background: none;
    color: var(--dark-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    padding: 0 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-text-button {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--primary-green);
    color: white;
    border: 2px solid var(--primary-green);
}

/* Dropped when top-nav buttons would crowd the logo (see updateNavGalleryVisibility) */
#nav-gallery-button.is-nav-crowded-hidden {
    display: none;
}

.nav-text-button:active {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    transform: scale(0.95);
}

.nav-button:active {
    opacity: 0.7;
}

/* Main 3D View */
#mobile-3d-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--sale-top-banner-height));
    left: 0;
    right: 0;
    bottom: var(--tab-bar-height);
    background: linear-gradient(to bottom, #e0e0e0, #f7f7f7);
}

#renderCanvas {
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
}

/* Bottom Tab Bar */
#mobile-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: var(--white);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: var(--z-tab-bar);
}

.tab-button, .buy-button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    color: var(--med-grey);
    font-size: 12px;
    cursor: pointer;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.tab-button svg, .buy-button svg {
    width: 24px;
    height: 24px;
}

.tab-button img.tab-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tab-button:active, .buy-button:active {
    background: rgba(0,0,0,0.05);
}

.tab-button.active {
    color: var(--primary-green);
    font-weight: bold;
    border-top: 3px solid var(--primary-green);
    background: rgba(76, 175, 80, 0.1);
}

.buy-button {
    color: var(--primary-green);
    font-weight: bold;
    border-left: 1px solid #e0e0e0;
}

.buy-button-icon-wrapper {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f44336;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Modal System */
.modal-drawer {
    position: fixed;
    left: 0;
    top: calc(var(--nav-height) + var(--sale-top-banner-height));
    bottom: var(--tab-bar-height);
    width: 100%;
    max-width: 500px;
    background: var(--white);
    border-radius: 0 20px 20px 0;
    z-index: var(--z-modal);
    transform: translateX(-100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-drawer.active {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: none;
}

/* Show headers for modals with navigation */
#purchase-modal .modal-header,
#info-menu-modal .modal-header,
#wood-info-modal .modal-header,
#wood-comparison-modal .modal-header,
#how-to-modal .modal-header,
#testimonials-modal .modal-header,
#processing-modal .modal-header,
#faq-modal .modal-header,
#gallery-info-modal .modal-header,
#quiz-info-modal .modal-header,
#gift-options-modal .modal-header,
#about-contact-modal .modal-header,
#accessories-modal .modal-header,
#loot-bag-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* Show minimal headers for bottom nav modals (wood, handle, guard, blade, finish) */
#wood-modal .modal-header,
#handle-modal .modal-header,
#mid-modal .modal-header,
#end-modal .modal-header,
#finish-modal .modal-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    min-height: 44px;
}

/* Adjust content padding for modals with headers */
#purchase-modal .modal-content,
#info-menu-modal .modal-content,
#wood-info-modal .modal-content,
#wood-comparison-modal .modal-content,
#how-to-modal .modal-content,
#testimonials-modal .modal-content,
#processing-modal .modal-content,
#faq-modal .modal-content,
#gallery-info-modal .modal-content,
#quiz-info-modal .modal-content,
#gift-options-modal .modal-content,
#about-contact-modal .modal-content,
#accessories-modal .modal-content,
#wood-modal .modal-content,
#handle-modal .modal-content,
#mid-modal .modal-content,
#end-modal .modal-content,
#finish-modal .modal-content {
    padding-top: 20px;
}

.modal-header h3 {
    font-family: 'Eagle Lake', cursive;
    font-size: 24px;
    margin: 0;
    padding: 0;
    flex: 1;
    text-align: center;
}

.modal-close {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    font-size: 32px;
    color: var(--med-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:active {
    opacity: 0.7;
}

.modal-back {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    color: var(--primary-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.modal-back:active {
    opacity: 0.7;
}

.modal-back svg {
    width: 24px;
    height: 24px;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-top: 60px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.modal-content-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    font-size: 32px;
    color: var(--med-grey);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}

.modal-content-close:active {
    opacity: 0.7;
}

/* Parts Grid */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 30px;
    width: 100%;
}

/* Handle and End grids - taller items, 2 columns; cap width so cards don't dominate wide drawers */
#handle-parts-grid,
#end-parts-grid {
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

#handle-parts-grid .part-item,
#end-parts-grid .part-item {
    aspect-ratio: 0.75; /* Taller for vertical parts */
}

#handle-parts-grid .part-item img,
#end-parts-grid .part-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Mid grid - square items */
#mid-parts-grid .part-item {
    aspect-ratio: 1;
    min-height: 100px;
}

.part-item {
    position: relative;
    background: #f7f7f7;
    border: 3px solid transparent;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 22px;
}

.part-item img {
    max-width: 85%;
    max-height: calc(85% - 8px);
    object-fit: contain;
}

.part-item:active {
    transform: scale(0.95);
}

.part-item.selected {
    border-color: var(--primary-green);
    background: rgba(26, 128, 43, 0.05);
}

.part-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.part-item.selected .part-checkmark {
    display: flex;
}

.part-label {
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--dark-grey);
}

/* Color Selection */
.color-section {
    margin-bottom: 20px;
}

.color-section h4 {
    font-family: 'Eagle Lake', cursive;
    font-size: 18px;
    margin-bottom: 15px;
}

.modal-content h4 {
    font-family: 'Eagle Lake', cursive;
    font-size: 18px;
    margin: 15px 0 10px 0;
    padding: 0;
}

.modal-content a{
    color: var(--primary-green);
}

.modal-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
    width: 100%;
}

/* FAQ Collapsible Styles */
.faq-section {
    margin-bottom: 30px;
}

.faq-section-header {
    font-family: 'Eagle Lake', cursive;
    font-size: 20px;
    margin: 0 0 15px 0;
    padding: 0;
    color: var(--primary-green);
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.faq-question:active {
    color: var(--primary-green);
}

.faq-question span {
    flex: 1;
    padding-right: 15px;
}

.faq-chevron {
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: var(--primary-green);
}

.faq-item.active .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
}

.faq-answer-content {
    padding: 0 0 15px 0;
}

.faq-answer-content p {
    margin: 0 0 10px 0;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

.accessories-list{
    line-height: 1.8; 
    margin-left: 0px;
}

.accessories-list li{
    margin-left: 10px;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-width: 280px;
    margin: 0 auto;
}

.color-item {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.color-swatch {
    width: 100%;
    max-width: 56px;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.color-swatch img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.color-item:active .color-swatch {
    transform: scale(0.92);
}

.color-item.selected .color-swatch {
    border-color: var(--primary-green);
    transform: scale(1.06);
}

.color-name {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    color: var(--dark-grey);
}

/* Wood Strips */
.wood-strips-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wood-tier-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-radius: 14px;
    border-left: 4px solid var(--tier-accent, var(--med-grey));
    background: var(--tier-soft, rgba(0, 0, 0, 0.03));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.wood-tier--1 {
    --tier-accent: var(--tier-1);
    --tier-soft: var(--tier-1-soft);
}

.wood-tier--2 {
    --tier-accent: var(--tier-2);
    --tier-soft: var(--tier-2-soft);
}

.wood-tier--3 {
    --tier-accent: var(--tier-3);
    --tier-soft: var(--tier-3-soft);
}

.wood-tier--special {
    --tier-accent: var(--tier-special);
    --tier-soft: var(--tier-special-soft);
}

.tier-label {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--tier-accent, var(--dark-grey));
    margin: 0;
    line-height: 1.3;
}

.wood-strip {
    position: relative;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.wood-strip-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
}

.wood-strip-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
}

.wood-strip-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wood-name {
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.wood-info-btn {
    position: absolute;
    right: 15px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.wood-info-btn:hover,
.wood-info-btn:active {
    background: var(--primary-green);
    color: #fff;
}

.wood-info-btn svg {
    display: block;
    flex-shrink: 0;
}

.wood-checkmark {
    position: absolute;
    left: 15px;
    top: 30%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--primary-green);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 2;
}

.wood-strip.selected .wood-checkmark {
    display: flex;
    animation: checkmarkPop 0.3s ease;
}

.wood-weight-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.wood-weight-badge .weight-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.wood-weight-badge span {
    white-space: nowrap;
    line-height: 1;
}

@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

.wood-strip:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.wood-strip:active {
    transform: scale(0.98);
}

.wood-strip.selected {
    border: 3px solid var(--primary-green);
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* Keep selected state raised even when not hovering */
.wood-strip.selected:hover {
    transform: translateY(-4px);
}

.wood-strip.special-order-wood {
    cursor: pointer;
}

.wood-strip.special-order-wood .wood-strip-bg::after {
    background: rgba(0,0,0,0.3);
}

.woodInfoDivs{
    text-align: center;
}

.woodInfoDivs > img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

/* Wood Info Stat Blocks */
.stat-block {
    margin: 20px auto;
    width: 100%;
    max-width: 400px;
    table-layout: fixed;
}

.stat-block tr {
    display: block;
    margin-bottom: 15px;
    width: 100%;
}

.stat-block td {
    display: block;
    width: 100%;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    width: 100%;
}

.stat-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.stat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stat-bar {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.stat-bar span {
    display: block;
    height: 100%;
    background: url(../images/stat-gradient.jpg) no-repeat;
    background-size: 100% 100%;
    border-radius: 12px;
}

.stat-desc {
    text-align: center;
    font-size: 14px;
    color: var(--dark-grey);
    padding: 0 10px;
}

/* Wood Comparison */
.wood-comparison-item {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.wood-comparison-item:last-child {
    border-bottom: none;
}

.wood-comparison-item h4 {
    font-family: 'Eagle Lake', cursive;
    font-size: 22px;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.wood-comparison-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 15px;
    border-radius: 8px;
}

.wood-comparison-desc {
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-grey);
    margin: 10px 0;
    padding: 0 10px;
}

/* Finish Options */
.finish-section {
    margin-bottom: 30px;
}

.finish-section h4 {
    font-family: 'Eagle Lake', cursive;
    font-size: 18px;
    margin-bottom: 15px;
}

.finish-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.finish-option {
    position: relative;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.finish-option img {
    width: 100%;
    height: auto;
    display: block;
}

.finish-label {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    background: #f7f7f7;
}

.finish-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

.finish-option.selected {
    border-color: var(--primary-green);
}

.finish-option.selected .finish-checkmark {
    display: flex;
}

.finish-description {
    font-size: 14px;
    color: var(--med-grey);
    line-height: 1.5;
}

.finish-gallery-link {
    margin-top: 10px;
    font-size: 14px;
}

.finish-gallery-link a {
    color: var(--primary-green);
    text-decoration: underline;
    font-weight: 600;
}

/* Wand Length Control */
.length-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#wandSizeLabel {
    font-size: 32px;
    font-family: 'Eagle Lake', cursive;
    color: var(--primary-green);
    font-weight: bold;
}

#wandLength {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: var(--primary-green);
    border-radius: 25px;
    outline: none;
    margin: 10px 0;
}

#wandLength::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 36px;
    height: 24px;
    background: var(--primary-green-dark);
    border-radius: 7px;
    cursor: pointer;
}

#wandLength::-moz-range-thumb {
    width: 36px;
    height: 24px;
    background: var(--primary-green-dark);
    border-radius: 7px;
    cursor: pointer;
    border: none;
}

/* Purchase Section */
.purchase-section {
    margin-bottom: 25px;
}

.purchase-section h4 {
    font-family: 'Eagle Lake', cursive;
    font-size: 18px;
    margin-bottom: 15px;
}

.design-code-display {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.design-code-display:active {
    background: #e0e0e0;
}

#designCodeText {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: var(--dark-grey);
}

.copy-hint {
    display: block;
    font-size: 12px;
    color: var(--med-grey);
    margin-top: 5px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* Multi-Step Purchase Flow */
.purchase-step {
    display: none;
}

.purchase-step.active {
    display: block;
}

.shop-selection-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.shop-selection-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px 15px;
    min-height: 60px;
}

.shop-selection-btn svg {
    width: 32px;
    height: 32px;
}

.shop-selection-btn span {
    font-size: 16px;
    line-height: 1.3;
}

/* Buy drawer: compact Made in Canada + shop cards */
.buy-canada-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px 10px;
    background: rgba(26, 128, 43, 0.06);
    border: 1px solid rgba(26, 128, 43, 0.14);
    border-radius: 8px;
}

.buy-canada-note__flag {
    width: 28px;
    height: auto;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.buy-canada-note span {
    font-size: 12px;
    line-height: 1.3;
    color: var(--dark-grey);
    font-weight: 500;
}

.buy-gift-section {
    margin-bottom: 16px;
    text-align: center;
}

.buy-gift-blurb {
    font-size: 13px;
    line-height: 1.4;
    color: var(--med-grey);
    margin: 0 0 10px;
}

.buy-gift-button {
    width: 100%;
    margin-bottom: 0;
}

.buy-shipping-note {
    margin-bottom: 18px;
}

.buy-shipping-note .small {
    margin: 0;
    line-height: 1.4;
}

.shop-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.shop-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 128px;
    padding: 12px 10px;
    margin: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    font-family: inherit;
    text-align: center;
}

.shop-card:hover,
.shop-card:focus {
    border-color: var(--primary-green);
    box-shadow: 0 2px 8px rgba(26, 128, 43, 0.12);
    outline: none;
}

.shop-card:active {
    transform: scale(0.98);
}

.shop-card--fbn {
    border-color: rgba(26, 128, 43, 0.35);
    background: rgba(26, 128, 43, 0.04);
}

.shop-card__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.shop-card__logo--etsy {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f1641e;
    font-size: 28px;
    line-height: 1;
}

.shop-card__title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark-grey);
}

.shop-card--fbn .shop-card__title {
    color: var(--primary-green-dark);
}

.shop-card__perk {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    color: #c83232;
}

.shop-card__perk-note {
    font-size: 10px;
    line-height: 1.3;
    color: var(--med-grey);
}

#view-loot-bag-shop.loot-bag-entry {
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.us-tariff-dialog {
    max-width: 420px;
    text-align: left;
}

.us-tariff-dialog h3 {
    text-align: center;
}

.us-tariff-dialog .app-confirm-message {
    text-align: left;
}

.us-tariff-list {
    margin: 0 0 16px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--dark-grey);
    max-height: min(50vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.us-tariff-list li {
    margin: 0 0 8px;
}

.us-tariff-list li:last-child {
    margin-bottom: 0;
}

.us-tariff-dialog .app-confirm-actions {
    justify-content: center;
}

.engraving-fee-notice {
    text-align: center;
    color: var(--med-grey);
    font-size: 14px;
    margin-bottom: 16px;
}

.engraving-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 auto 20px;
    max-width: min(280px, 72%);
    width: 100%;
}

.engraving-example img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background: #f3f0ea;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.engraving-example figcaption {
    font-size: 13px;
    color: var(--med-grey);
    text-align: center;
    line-height: 1.3;
}

.engraving-question {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.engraving-choice-btn {
    padding: 20px 15px;
}

.fbn-order-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
}

.fbn-order-summary__row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fbn-order-summary__label {
    font-size: 12px;
    font-weight: 650;
    color: var(--med-grey);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fbn-order-summary__value {
    font-size: 15px;
    color: var(--dark-grey);
    line-height: 1.35;
    word-break: break-word;
}

.accessory-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.accessory-choice-btn {
    padding: 16px 14px;
    text-align: left;
}

.accessory-choice-btn.primary-button {
    outline: 2px solid var(--accent, #1a802b);
}

/* 2-column accessory card grid (Buy flow) */
.accessory-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.accessory-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.accessory-card__hit {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.accessory-card:hover,
.accessory-card:focus-within {
    border-color: rgba(26, 128, 43, 0.45);
}

.accessory-card.is-selected {
    border-color: #1a802b;
    box-shadow: 0 0 0 1px #1a802b, 0 2px 8px rgba(26, 128, 43, 0.18);
}

.accessory-card__media {
    display: block;
    aspect-ratio: 1 / 1;
    background: #f3f0ea;
    overflow: hidden;
}

.accessory-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.accessory-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 10px 8px;
}

.accessory-card__title {
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    color: #2a2620;
}

.accessory-card__price {
    font-size: 12px;
    font-weight: 600;
    color: #1a802b;
}

.accessory-card__price-was {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-decoration: line-through;
    margin-left: 2px;
}

.accessory-card__price--free {
    color: #6a6258;
    font-weight: 500;
}

.accessory-card__check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a802b;
    color: #fff;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.accessory-card.is-selected .accessory-card__check {
    opacity: 1;
    transform: scale(1);
}

.accessory-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 8px 10px;
}

.accessory-variant {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
    background: #f7f5f0;
    color: #3a342c;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.accessory-variant.is-active {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2px rgba(26, 128, 43, 0.55);
}

.accessory-variant.is-active::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1a802b;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Stand woods */
.accessory-variant--cherry {
    background: #d4a574;
    color: #3b2412;
}

.accessory-variant--walnut {
    background: #4a2f1c;
    color: #f3e6d4;
}

/* Holster colors */
.accessory-variant--black {
    background: #1c1c1c;
    color: #f2f2f2;
}

.accessory-variant--brown {
    background: #8b5a2b;
    color: #fff6ea;
}

.accessory-variant--green {
    background: #2f6b3a;
    color: #eef8ef;
}

.accessory-variant--purple {
    background: #5b3d7a;
    color: #f4ecfb;
}

.accessory-variant--red {
    background: #9b2c2c;
    color: #ffecec;
}

.accessory-variant--blue {
    background: #2c4f8a;
    color: #eaf1ff;
}

@media (max-width: 340px) {
    .accessory-card-grid {
        gap: 8px;
    }
    .accessory-card__title {
        font-size: 12px;
    }
    .accessory-variant {
        font-size: 10px;
        padding: 3px 7px;
    }
}

.character-counter {
    text-align: right;
    font-size: 12px;
    color: var(--med-grey);
    margin-top: 5px;
}

.etsy-copy-section {
    margin-bottom: 20px;
}

.etsy-copy-section p {
    margin-bottom: 10px;
    font-size: 14px;
}

.etsy-copy-section .design-code-display {
    background: #f7f7f7;
    padding: 15px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.etsy-instructions {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
}

.etsy-instructions p {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--dark-grey);
}

.etsy-instructions ul {
    margin-bottom: 0;
}

.etsy-instructions li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark-grey);
}

.etsy-instructions li:last-child {
    margin-bottom: 0;
}

.purchase-back-button {
    background: none;
    border: none;
    color: var(--primary-green);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.purchase-back-button:active {
    opacity: 0.6;
}

.purchase-back-button svg {
    width: 24px;
    height: 24px;
}

/* Buttons */
.button {
    display: block;
    width: 100%;
    padding: 15px;
    /* Reserve 2px so styles.css .button:hover border doesn't shift layout */
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    margin-bottom: 10px;
}

.button.us-tariff-button {
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
    background: #c83232;
    color: #fff !important;
    border-color: #c83232;
}

.button.us-tariff-button:hover,
.button.us-tariff-button:focus {
    background: #a82828 !important;
    border-color: #a82828 !important;
    color: #fff !important;
}

.button.us-tariff-button:active {
    background: #8f2222 !important;
    border-color: #8f2222 !important;
    color: #fff !important;
    transform: scale(0.98);
}

.primary-button {
    background: var(--primary-green);
    color: white !important;
    border-color: var(--primary-green);
}

.primary-button:hover,
.primary-button:focus {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    color: white !important;
}

.primary-button:active {
    background: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    color: white !important;
    transform: scale(0.98);
}

.secondary-button {
    background: white;
    color: var(--primary-green) !important;
    border-color: var(--primary-green);
}

.secondary-button:hover,
.secondary-button:focus {
    background: white;
    color: var(--primary-green-light) !important;
    border-color: var(--primary-green-light);
}

.secondary-button:active {
    background: var(--primary-green);
    color: white !important;
    border-color: var(--primary-green);
    transform: scale(0.98);
}

.sale-banner {
    margin: 10px 0;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
}

.sale-banner:empty {
    display: none;
}

/* Sale headline + countdown (parity with legacy builder-styles) */
.sale-notice {
    margin: 0 0 14px;
    padding: 12px 14px 14px;
    text-align: center;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(216, 52, 44, 0.09) 0%, rgba(13, 64, 22, 0.06) 100%);
    border: 1px solid rgba(13, 64, 22, 0.22);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sale-notice--inactive {
    display: none;
}

.sale-notice__headline {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: #1a5c24;
    margin-bottom: 6px;
    line-height: 1.35;
}

.sale-notice__countdown {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.98rem;
    font-weight: 600;
    color: #0d4016;
    background-color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(13, 64, 22, 0.18);
    border-radius: 6px;
}

.sale-notice__countdown:empty {
    display: none;
}

.sale-notice__countdown-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5a6b5e;
    margin-bottom: 2px;
}

.sale-notice__countdown-time {
    display: block;
    font-variant-numeric: tabular-nums;
}

.tier-label__was {
    text-decoration: line-through;
    color: #888;
    font-weight: 500;
}

#saleValue {
    color: #cc0000;
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid rgba(255, 0, 0, 0.15);
}

#saleBanner {
    color: var(--primary-green-dark);
    background: rgba(13, 64, 22, 0.05);
    border: 1px solid rgba(13, 64, 22, 0.15);
}

/* Info Menu */
.info-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f7f7f7;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    min-height: 120px;
}

.info-menu-item:active {
    transform: scale(0.95);
    background: #e0e0e0;
}

.info-menu-item svg,
.info-menu-item i {
    color: var(--primary-green);
}

.info-menu-item span {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

/* Mobile Bag of Holding Toggle (under loyalty widgets, above tab bar) */
#mobile-cart-toggle {
    position: fixed;
    bottom: 130px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--background);
    color: var(--primary-green);
    border: solid 2px var(--primary-green);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: var(--z-gratisfaction);
    display: none; /* shown only when cart has items */
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
    font-size: 20px;
}

#mobile-cart-toggle.is-visible {
    display: flex;
}

#mobile-cart-toggle:active {
    transform: scale(0.9);
}

#mobile-cart-toggle .cart-badge {
    top: -4px;
    right: -4px;
}

#mobile-cart-toggle i {
    line-height: 1;
    pointer-events: none;
}

/* Bag of Holding drawer — slides from the right; stacks above other drawers */
.loot-bag-drawer {
    position: fixed;
    right: 0;
    left: auto;
    top: calc(var(--nav-height) + var(--sale-top-banner-height));
    bottom: var(--tab-bar-height);
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: 20px 0 0 20px;
    z-index: var(--z-loot-bag);
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

.loot-bag-drawer.active {
    transform: translateX(0);
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
}

/* Confirms sit over the bag panel, not the full viewport */
.loot-bag-drawer .app-confirm-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    padding: 16px;
}

.loot-bag-drawer .app-confirm-dialog {
    max-width: 100%;
}

.loot-bag-drawer .modal-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.loot-bag-empty {
    text-align: center;
    padding: 32px 12px;
    color: var(--med-grey);
}

.loot-bag-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loot-bag-item {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--background);
}

.loot-bag-item__title {
    font-weight: bold;
    font-size: 15px;
    color: var(--dark-grey);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.loot-bag-item__meta {
    font-size: 13px;
    color: var(--med-grey);
    line-height: 1.4;
    word-break: break-word;
}

.loot-bag-item__meta strong {
    color: var(--dark-grey);
    font-weight: 600;
}

.loot-bag-item__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.loot-bag-item__price {
    font-weight: bold;
    color: var(--primary-green);
}

.loot-bag-item__actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.loot-bag-item__actions .button {
    flex: 1 1 0;
    min-width: 0;
    font-size: 13px;
    padding: 8px 12px;
    margin-bottom: 0;
    /* Reserve border so styles.css .button:hover doesn't shift layout */
    border: 2px solid transparent;
    box-sizing: border-box;
}

.loot-bag-item__actions .primary-button {
    border-color: var(--primary-green);
}

.loot-bag-item__actions .primary-button:hover,
.loot-bag-item__actions .primary-button:focus {
    border-color: var(--primary-green-dark);
    background: var(--primary-green-dark);
}

.loot-bag-item__actions .secondary-button {
    border-color: var(--primary-green);
}

.loot-bag-item__actions .secondary-button:hover,
.loot-bag-item__actions .secondary-button:focus {
    border-color: var(--primary-green-light);
}

.loot-bag-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loot-bag-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.shop-selection-buttons .loot-bag-entry {
    margin-top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loot-bag-entry i {
    font-size: 14px;
}

#view-loot-bag-fbn.loot-bag-entry {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* App-styled confirm dialog (used by Load Design, etc.) */
.app-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-confirm);
    background: rgba(33, 33, 33, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    -webkit-tap-highlight-color: transparent;
}

.app-confirm-dialog {
    width: 100%;
    max-width: 360px;
    background: var(--white);
    border-radius: 16px;
    padding: 24px 20px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.app-confirm-dialog h3 {
    font-family: 'Eagle Lake', cursive;
    font-size: 22px;
    color: var(--primary-green);
    margin: 0 0 12px;
}

.app-confirm-message {
    font-size: 15px;
    color: var(--dark-grey);
    line-height: 1.45;
    margin: 0 0 12px;
}

.app-confirm-code {
    font-size: 12px;
    color: var(--med-grey);
    word-break: break-all;
    background: var(--background);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 16px;
    text-align: left;
}

#loot-bag-remove-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: normal;
}

.app-confirm-actions {
    display: flex;
    gap: 8px;
}

.app-confirm-actions .button {
    flex: 1;
    margin-bottom: 0;
    border: 2px solid transparent;
    box-sizing: border-box;
    padding: 12px;
    font-size: 14px;
}

.app-confirm-actions .primary-button {
    border-color: var(--primary-green);
}

.app-confirm-actions .primary-button:hover,
.app-confirm-actions .primary-button:focus {
    border-color: var(--primary-green-dark);
    background: var(--primary-green-dark);
}

.app-confirm-actions .secondary-button {
    border-color: var(--primary-green);
}

.app-confirm-actions .primary-button:disabled,
.app-confirm-actions .primary-button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--med-grey);
    border-color: var(--med-grey);
    color: var(--white);
}

.app-confirm-actions .primary-button:disabled:hover,
.app-confirm-actions .primary-button:disabled:focus,
.app-confirm-actions .primary-button[disabled]:hover,
.app-confirm-actions .primary-button[disabled]:focus {
    background: var(--med-grey);
    border-color: var(--med-grey);
}

.load-design-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-grey);
    margin: 0 0 6px;
}

.load-design-input {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.35;
    padding: 12px;
    border: 2px solid var(--light-grey);
    border-radius: 8px;
    background: var(--background);
    color: var(--dark-grey);
    margin: 0 0 8px;
}

.load-design-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.load-design-input[aria-invalid="true"] {
    border-color: #b00020;
}

.load-design-hint {
    min-height: 1.2em;
    font-size: 12px;
    line-height: 1.35;
    margin: 0 0 16px;
    text-align: left;
    color: var(--med-grey);
}

.load-design-hint--ok {
    color: var(--primary-green);
}

.load-design-hint--err {
    color: #b00020;
}

/* Hide Ecwid's default cart widget styling and show our custom icon */
#mobile-cart-toggle .ec-cart-widget {
    display: none;
}

/* Hide the fallback icon when Ecwid loads */
#mobile-cart-toggle .ec-cart-widget:not(:empty) ~ #cart-icon-fallback {
    display: none;
}

/* Show fallback icon if Ecwid hasn't loaded yet */
#cart-icon-fallback {
    pointer-events: none;
}

#gr_paybypoints_widget{
    bottom:200px !important;
    left:auto !important;
    right: 45px !important;
    z-index: 100000 !important;
    transform: translateX(-20%) !important;
}

#grPbyP_icon figure, .am-widgetbar-gratisfaction.am-mob-compact, .am-GRwidgetbar-box{
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

#gr-am-widgetbar_27709{
    bottom:270px !important;
    left:auto !important;
    right: 25px !important;
    z-index: 100000 !important;
}

/* Mailchimp teaser (#el_LmpuMVbno2) lives in an open Shadow DOM — hidden via
   inc/builder/inc.footer.php (injects display:none into that root). */

/* Hide loyalty widgets while zoomed into a wand section */
body.selection-mode-active #gr_paybypoints_widget,
body.selection-mode-active #gr-am-widgetbar_27709,
body.selection-mode-active .am-widgetbar-gratisfaction,
body.selection-mode-active .am-GRwidgetbar-box,
body.selection-mode-active #mobile-cart-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Ecwid Popup Scroll Fix */
/* Allow Ecwid popups to be scrollable despite body overflow:hidden */
.popupContent,
.ecwid .popupContent,
.ecwid-popup .popupContent,
div[class*="ecwid"] .popupContent,
div[class*="ec-"] .popupContent {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 80vh !important;
    touch-action: pan-y !important;
}

/* Ensure Ecwid popup containers have proper positioning */
.popup,
.ecwid .popup,
.ecwid-popup,
div[class*="ecwid"] .popup,
div[class*="ec-"] .popup {
    position: fixed !important;
    z-index: 1000001 !important;
}

/* Allow touch scrolling on Ecwid popup content areas */
.popup__content,
.ecwid .popup__content,
.ecwid-popup .popup__content,
div[class*="ecwid"] .popup__content,
div[class*="ec-"] .popup__content {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

/* Additional Ecwid modal/overlay fixes */
div[class*="ec-"] div[class*="modal"],
div[class*="ec-"] div[class*="overlay"] {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

#InApp_currency_converter, .ec-footer, .ec-cart-step--legallinks{
    display:none !important;
}

/* Utility Classes */
.offscreen {
    position: absolute;
    left: -9999px;
}

.center {
    text-align: center;
}

.small {
    font-size: 14px;
}

/* Responsive Adjustments */
@media (min-width: 375px) {
    /* Keep parts at 2 columns for better visibility */
    .parts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .colors-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        max-width: 300px;
    }
}

@media (min-width: 414px) {
    :root {
        --nav-height: 64px;
        --tab-bar-height: 84px;
    }
    
    .nav-logo img {
        height: 44px;
    }
    
    .tab-button, .buy-button {
        font-size: 13px;
    }
    
    .tab-button svg, .buy-button svg {
        width: 26px;
        height: 26px;
    }
    
    .tab-button img.tab-icon {
        width: 26px;
        height: 26px;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    :root {
        --nav-height: 50px;
        --tab-bar-height: 60px;
    }
    
    .modal-drawer {
        max-height: 90vh;
    }
}

/* Hide Gratisfaction widget by default */
.ywxi-widget {
    display: none !important;
}

.ywxi-widget.visible {
    display: block !important;
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Loading Indicator - Magic Wand Spinner */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--primary-green);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.loading-indicator.active {
    opacity: 1;
    visibility: visible;
}

/* Loading Spinner Overlay for Cards and Wood Strips */
.part-item-loading-spinner,
.wood-strip-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: var(--primary-green);
    z-index: 10;
    pointer-events: none;
}

/* Exit (X) — top of the right selection column */
.exit-selection-btn {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.exit-selection-btn:active {
    transform: scale(0.9);
    background: var(--primary-green);
    color: white;
}

/* Section up/down nav — lives inside the right stain column */
.section-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

.section-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    color: var(--dark-grey, #333);
    font-size: 18px;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.section-nav-btn:active:not(:disabled) {
    transform: scale(0.92);
    opacity: 0.85;
}

.section-nav-btn:focus,
.section-nav-btn:focus-visible {
    outline: none;
}

.section-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* Right column: exit + stain stack + section nav as one unit with a fixed gap */
.selection-side-column {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 20;
    will-change: left, top, opacity;
    opacity: 0;
    pointer-events: none;
}

.selection-side-column.active {
    display: flex;
    transition:
        opacity 0.38s ease,
        left var(--selection-layout-ms, 0.5s) ease-in-out,
        top var(--selection-layout-ms, 0.5s) ease-in-out;
}

.selection-side-column.active.is-ready {
    opacity: 1;
    pointer-events: auto;
}

.selection-side-column.is-positioning {
    transition: none !important;
}

/* Stacks inside the column participate in flex flow (column owns absolute pos) */
.selection-side-column .option-stack {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: flex;
    opacity: 1;
    pointer-events: auto;
    will-change: auto;
    transition: none;
}

.selection-side-column .option-stack.active {
    display: flex;
}

@media (prefers-reduced-motion: reduce) {
    .selection-side-column.active {
        transition: none;
    }
}

/* Selection option stacks — design (left) / stain (right), prev · current · next */
.option-stack {
    --option-scale: 1;
    position: absolute;
    top: 50%;
    left: 8px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: calc(8px * var(--option-scale));
    z-index: 20;
    width: calc(76px * var(--option-scale));
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    will-change: left, top, opacity;
    opacity: 0;
    pointer-events: none;
}

.option-stack.active {
    display: flex;
    transition:
        opacity 0.38s ease,
        left var(--selection-layout-ms, 0.5s) ease-in-out,
        top var(--selection-layout-ms, 0.5s) ease-in-out;
}

.option-stack.active.is-ready {
    opacity: 1;
    pointer-events: auto;
}

.option-stack.is-positioning {
    transition: none !important;
}

.option-stack--stain {
    left: auto;
    right: 8px;
}

/* Stain stack inside the right column: flex child, column owns placement */
.selection-side-column .option-stack,
.selection-side-column .option-stack.active {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: flex;
    opacity: 1;
    pointer-events: auto;
    will-change: auto;
    transition: none;
}

.option-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: calc(4px * var(--option-scale));
    width: 100%;
    margin: 0;
    padding: calc(6px * var(--option-scale)) calc(4px * var(--option-scale)) calc(5px * var(--option-scale));
    border-radius: calc(10px * var(--option-scale));
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center center;
}

.option-slot--adj {
    cursor: pointer;
    transform: scale(0.8);
    opacity: 0.92;
}

.option-slot--adj:active {
    opacity: 0.8;
}

.option-slot--adj:focus,
.option-slot--adj:focus-visible {
    outline: none;
}

.option-slot--current {
    transform: scale(1);
    border-width: 2px;
    border-color: var(--primary-green, #2f6b4f);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

.option-slot-img {
    display: block;
    flex-shrink: 0;
    border-radius: calc(6px * var(--option-scale));
}

.option-stack--design .option-slot-img {
    width: calc(56px * var(--option-scale));
    height: calc(72px * var(--option-scale));
    object-fit: contain;
}

.option-stack--stain .option-slot-img {
    width: calc(40px * var(--option-scale));
    height: calc(40px * var(--option-scale));
    object-fit: cover;
    border-radius: 50%;
}

.option-slot-name {
    display: block;
    width: 100%;
    font-size: calc(10px * var(--option-scale));
    line-height: 1.15;
    font-weight: 600;
    color: var(--dark-grey);
    text-align: center;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
}

.option-stack--design .option-slot-name {
    white-space: nowrap;
}

.option-stack.is-animating {
    pointer-events: none;
}

.option-slot.is-flipping {
    will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
    .option-stack.active {
        transition: none;
    }

    .option-slot.is-flipping {
        transition: none !important;
    }
}

/* Tutorial Banners */
.tutorial-banner {
    position: fixed;
    bottom: var(--tab-bar-height);
    left: 0;
    right: 0;
    background: var(--primary-green);
    color: white;
    padding: 12px 50px 12px 20px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 95;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.tutorial-banner.active {
    display: flex;
}

.tutorial-banner.swipe-banner {
    background: var(--primary-green-dark);
    /* Only show when tap banner is not visible (in selection mode) */
}

.tutorial-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.tutorial-close:active {
    background: rgba(255,255,255,0.4);
}

/* Gallery Text */
.gallery-text {
    display: block;
    text-align: center;
    font-size: 16px;
    color: var(--white);
    margin-top: 8px;
    font-weight: normal;
}

/* Gallery text inside buttons should inherit button styling */
.button .gallery-text {
    display: inline;
    margin-top: 0;
    font-weight: bold;
    color: inherit;
}

/* Footer - Hidden on mobile, content moved to info modals */
#footer {
    display: none;
}

