/* =============================================================
   Breakdance column overrides for this product page
   Left col (103) = preview, right col (105) = configurator
   ============================================================= */

/* Suppress WooProductImages and old WAPF output */
.bde-wooproductimages-87-104,
.woocommerce-product-gallery,
.wapf, .wapf-wrapper { display: none !important; }

/* Left column: let preview fill the full column width */
.bde-column-87-103 {
    align-items: stretch !important;
    text-align: left !important;
}
.bde-column-87-103 .bde-code-block {
    width: 100%;
}

/* Right column: let configurator fill the full column width */
.bde-column-87-105 {
    align-items: stretch !important;
}
.bde-column-87-105 .bde-code-block,
.bde-column-87-105 .bde-div {
    width: 100%;
}

/* Remove CodeBlock wrapper padding/constraints */
.bde-code-block-87-143,
.bde-code-block-87-162 {
    width: 100%;
    max-width: 100%;
}
/* =============================================================
   Household Memories Canvas — Product Page
   Brand: DM Sans / Crimson Text
   Primary: #9f817c  Navy: #222e46  Text: #1D1D1D
   Border: #D6D6D6   Surface: #F5F5F5
   ============================================================= */

/* Suppress WAPF / old gallery */
.wapf, .wapf-wrapper, .woocommerce-product-gallery { display: none !important; }

/* ============================================================
   Preview column (left)
   ============================================================ */
.hmfc-preview-wrap {
    position: relative;
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.hmfc-frame-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: transparent;
    border-radius: 4px;
    min-height: 320px;
    cursor: default;
    overflow: visible;
}

.hmfc-frame-spacer {
    display: block;
    width: 100%;
    height: auto;
    visibility: hidden;
    pointer-events: none;
    min-height: 320px;
}

.hmfc-photo-zone {
    position: absolute;
    overflow: hidden;
    cursor: grab;
    touch-action: none;   /* JS handles all touch gestures */
}
.hmfc-photo-zone:active { cursor: grabbing; }

.hmfc-photo-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    touch-action: none;
}

/* Upload prompt inside the frame opening */
.hmfc-upload-prompt {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.hmfc-upload-prompt__icon {
    color: #9f817c;
    width: 32px;
    height: 32px;
    opacity: 0.5;
}
.hmfc-upload-prompt__icon svg { width: 100%; height: 100%; }
.hmfc-upload-prompt__label {
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    color: #9f817c;
    opacity: 0.7;
    text-align: center;
    margin: 0;
}

/* Customer photo */
.hmfc-customer-photo {
    position: absolute;
    top: 0;
    left: 0;
    /* width/height set to natural px by JS */
    max-width: none;
    max-height: none;
    display: none;
    transform-origin: 0 0;
    touch-action: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Frame overlay on top */
.hmfc-frame-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.hmfc-frame-overlay.is-loaded { opacity: 1; }

/* Low-res warning */
.hmfc-lowres-warning {
    display: none;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.hmfc-lowres-warning svg { flex-shrink:0; width:17px; height:17px; color:#d97706; margin-top:2px; }
.hmfc-lowres-warning span { font-family:"DM Sans",sans-serif; font-size:12px; color:#92400e; line-height:1.5; }

/* Photo controls */
.hmfc-photo-controls {
    display: none;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    width: 80%;
    margin: 0 auto;
}
.hmfc-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid #D6D6D6;
    border-radius: 5px;
    background: #fff;
    color: #1D1D1D;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.hmfc-btn-ghost:hover { border-color: #9f817c; background: #faf8f7; }

/* ============================================================
   Configurator (right column)
   ============================================================ */
.hmfc-configurator {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 90px;
    width: 100%;
    box-sizing: border-box;
}

.hmfc-step { width: 100%; }

.hmfc-step__label {
    font-family: "Crimson Text", serif;
    font-size: 18px;
    color: #222e46;
    font-weight: 600;
    margin: 0 0 12px;
    display: block;
}

/* ---- Drop zone -------------------------------------------- */
.hmfc-dropzone {
    width: 100%;
    border: 2px dashed #D6D6D6;
    border-radius: 10px;
    background: #faf8f7;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hmfc-dropzone:hover,
.hmfc-dropzone.is-dragover {
    border-color: #9f817c;
    background: #f5f0ee;
}

.hmfc-dropzone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 20px;
    text-align: center;
    width: 100%;
}

.hmfc-dropzone__icon {
    width: 36px;
    height: 36px;
    color: #9f817c;
    opacity: 0.7;
    flex-shrink: 0;
}

.hmfc-dropzone__text {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.hmfc-dropzone__sub {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.hmfc-dropzone__browse {
    background: none;
    border: none;
    padding: 0;
    color: #9f817c;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.hmfc-dropzone__browse:hover { color: #7a5f5b; }

.hmfc-dropzone__hint {
    font-family: "DM Sans", sans-serif;
    font-size: 11.5px;
    color: #9ca3af;
    margin: 0;
}

/* Uploading state inside dropzone */
.hmfc-dropzone__uploading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    width: 100%;
}
.hmfc-dropzone__uploading p {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Spinner */
.hmfc-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #9f817c;
    border-radius: 50%;
    animation: hmfc-spin 0.7s linear infinite;
}
@keyframes hmfc-spin { to { transform: rotate(360deg); } }

/* ---- Size grid: 4 per row, full width --------------------- */
.hmfc-size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}

.hmfc-size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 11px 4px;
    border: 1.5px solid #D6D6D6;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    width: 100%;
    text-align: center;
    line-height: 1.2;
}
.hmfc-size-btn:hover {
    border-color: #9f817c;
    background: #faf8f7;
}
.hmfc-size-btn.is-selected {
    border-color: #9f817c;
    background: #faf8f7;
    box-shadow: 0 0 0 2.5px rgba(159,129,124,0.22);
}
.hmfc-size-btn__dim {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #222e46;
}
.hmfc-size-btn__price {
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    color: #6b7280;
}

/* ---- Color row -------------------------------------------- */
.hmfc-color-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}

.hmfc-color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1.5px solid #D6D6D6;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.hmfc-color-btn:hover { border-color: #9f817c; }
.hmfc-color-btn.is-selected {
    border-color: #9f817c;
    box-shadow: 0 0 0 2.5px rgba(159,129,124,0.22);
}
.hmfc-color-swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
}
.hmfc-swatch--espresso { background: #3b1f0e; }
.hmfc-swatch--natural  { background: #c8a97a; }
.hmfc-swatch--black    { background: #1a1a1a; }
.hmfc-swatch--white    { background: #f4f0eb; border-color: #D6D6D6; }
.hmfc-color-label {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    color: #1D1D1D;
}

/* ============================================================
   Sticky bottom bar
   ============================================================ */
.hmfc-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: #fff;
    border-top: 1px solid #ebebeb;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
    padding: 12px 20px env(safe-area-inset-bottom, 4px);
    box-sizing: border-box;
}
.hmfc-sticky-bar__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.hmfc-sticky-bar__price { display: flex; flex-direction: column; gap: 1px; }
.hmfc-price-label { font-family:"DM Sans",sans-serif; font-size:10.5px; text-transform:uppercase; letter-spacing:0.08em; color:#9ca3af; }
.hmfc-price-value { font-family:"Crimson Text",serif; font-size:26px; font-weight:600; color:#222e46; line-height:1; }
.hmfc-price-discount { font-family:"DM Sans",sans-serif; font-size:12px; color:#047857; font-weight:500; min-height:16px; }
.hmfc-sticky-bar__actions { display:flex; align-items:center; gap:10px; }
.hmfc-qty-wrap { display:flex; align-items:center; border:1.5px solid #D6D6D6; border-radius:6px; overflow:hidden; height:46px; }
.hmfc-qty-btn { width:36px; height:100%; background:#F5F5F5; border:none; font-size:18px; color:#374151; cursor:pointer; padding:0; transition:background 0.15s; line-height:1; }
.hmfc-qty-btn:hover { background:#e5e7eb; }
.hmfc-qty-input { width:46px; height:100%; text-align:center; border:none; border-left:1px solid #D6D6D6; border-right:1px solid #D6D6D6; font-family:"DM Sans",sans-serif; font-size:15px; color:#1D1D1D; -moz-appearance:textfield; appearance:textfield; }
.hmfc-qty-input::-webkit-outer-spin-button, .hmfc-qty-input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.hmfc-atc-btn { height:46px; padding:0 28px; background:#9f817c; color:#fff; border:none; border-radius:6px; font-family:"DM Sans",sans-serif; font-size:15px; font-weight:500; cursor:pointer; transition:background 0.2s, opacity 0.2s; white-space:nowrap; }
.hmfc-atc-btn:disabled { opacity:0.4; cursor:not-allowed; }
.hmfc-atc-btn:not(:disabled):hover { background:#8a6f6a; }
.hmfc-atc-btn.is-loading { opacity:0.65; pointer-events:none; }

body.single-product { padding-bottom: 80px; }

@media (max-width: 600px) {
    .hmfc-size-grid  { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .hmfc-color-row  { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .hmfc-size-btn__dim { font-size: 11px; }
    .hmfc-size-btn__price { font-size: 10px; }
    .hmfc-atc-btn { padding: 0 16px; font-size: 14px; }
}
/* Drag-over state on the live preview */
.hmfc-frame-stage.is-dragover::after {
    content: 'Drop photo here';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(159,129,124,0.15);
    border: 2px dashed #9f817c;
    border-radius: 4px;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #9f817c;
    z-index: 10;
    pointer-events: none;
}
