/* =====================================================
   Adult Content Blur — Front-end Styles v2.1
   ===================================================== */

/* Wrapper — must NOT override WooCommerce gallery layout */
.acb-wrap {
    position: relative;
    display: inline-block; /* was: block — caused layout break in gallery columns */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: inherit;
    isolation: isolate;
    vertical-align: top;  /* prevent inline-block gap */
    line-height: 0;       /* collapse whitespace gap under image */
}

/* Inside flex/grid containers (WooCommerce gallery columns) */
.woocommerce-product-gallery__image .acb-wrap,
.woocommerce-product-gallery__image > .acb-wrap,
[class*="woocommerce-product-gallery"] .acb-wrap {
    display: block;
    width: 100%;
    height: 100%;
}

/* Blurred image */
.acb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    filter: blur(var(--acb-blur, 14px));
    transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: filter;
    transform: translateZ(0); /* GPU layer */
    user-select: none;
    -webkit-user-drag: none;
}

.acb-wrap.acb-revealed img {
    filter: blur(0) !important;
}

/* Overlay */
.acb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: inherit;
    transition: opacity 0.4s ease;
    z-index: 10;
}

/* Dark overlay */
.acb-overlay.acb-dark {
    background: rgba(15, 15, 25, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Light overlay */
.acb-overlay.acb-light {
    background: rgba(240, 240, 255, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.acb-wrap.acb-revealed .acb-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Reveal Button */
.acb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    color: #fff;
    padding: 12px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

/* Light overlay button adjustments */
.acb-overlay.acb-light .acb-btn {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0,0,0,0.12);
    color: #1f2937;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.acb-btn:hover {
    transform: scale(1.06) translateY(-2px);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

.acb-btn:active  { transform: scale(0.96); }

.acb-icon {
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.acb-btn-text { display: block; white-space: nowrap; }

/* Sub-text */
.acb-sub {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.03em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.acb-overlay.acb-light .acb-sub { color: #6b7280; text-shadow: none; }

/* 18+ badge after reveal */
.acb-wrap.acb-revealed.acb-badge::after {
    content: "18+";
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

/* Single product gallery — restore natural sizing */
.acb-single {
    border-radius: 8px;
    display: block;
    width: 100%;
    line-height: 0;
}

/* Thumbnail wrappers — must not stretch or collapse */
.acb-wrap:not(.acb-single) {
    display: inline-block;
    width: auto;
    max-width: 100%;
    line-height: 0;
}

/* Fix: WooCommerce flex gallery children should stay full-width */
.flex-viewport .acb-wrap,
.woocommerce-product-gallery__wrapper .acb-wrap {
    display: block !important;
    width: 100% !important;
}

/* Age gate modal backdrop */
.acb-age-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: acbFadeIn 0.2s ease;
}

@keyframes acbFadeIn { from { opacity: 0; } to { opacity: 1; } }

.acb-age-modal {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px;
    max-width: 400px;
    width: calc(100% - 32px);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    animation: acbSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes acbSlideUp { from { transform: translateY(30px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.acb-age-modal .acb-age-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.acb-age-modal h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px;
}

.acb-age-modal p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px;
}

.acb-age-modal .acb-age-confirm {
    display: block;
    width: 100%;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.acb-age-modal .acb-age-confirm:hover { background: #b91c1c; }

.acb-age-modal .acb-age-cancel {
    display: block;
    width: 100%;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.acb-age-modal .acb-age-cancel:hover { background: #e5e7eb; }

/* Accessibility */
.acb-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
