/* ==========================================================================
   GA Woo Elementor Widgets — v1.2
   ========================================================================== */

/* ------------------------------------------------------------------
   Editor placeholder
   ------------------------------------------------------------------ */
.wew-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    background: #f6f6f7;
    border: 2px dashed #d1d1d1;
    border-radius: 8px;
    color: #999;
    text-align: center;
}
.wew-placeholder [class*="eicon"] { font-size: 36px; opacity: .4; }
.wew-placeholder p { margin: 0; font-size: 13px; }

/* ==========================================================================
   PRODUCT GALLERY
   ========================================================================== */

.wew-gallery {
    display: flex;
    gap: 12px;
    width: 100%;
    --wew-thumb-size: 76px;
}

/* Left layout */
.wew-gallery--left {
    flex-direction: row;
    align-items: flex-start;
}
.wew-gallery--left .wew-gallery__main {
    flex: 1;
    min-width: 0;
}
.wew-gallery--left .wew-gallery__thumbs {
    order: -1; /* thumbs on left */
    flex-direction: column;
    width: var(--wew-thumb-size);
    flex-shrink: 0;
    max-height: var(--wew-main-height, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.wew-gallery--left .wew-gallery__thumbs::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Bottom layout */
.wew-gallery--bottom {
    flex-direction: column;
}
.wew-gallery--bottom .wew-gallery__main {
    width: 100%;
}
.wew-gallery--bottom .wew-gallery__thumbs {
    display: grid !important;
    flex-direction: unset;
    grid-template-columns: repeat(var(--wew-thumb-columns, 5), 1fr);
}

/* ------------------------------------------------------------------
   Main image
   ------------------------------------------------------------------ */
.wew-gallery__main {
    position: relative;
    background-color: transparent;
    border: 1px solid rgba(64, 71, 58, 0.24);
    border-radius: 0;
    overflow: hidden;
    aspect-ratio: auto;
}

.wew-gallery__main-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform-origin: 50% 50%;
    transition: opacity 0.2s ease, transform 0.18s ease-out;
    will-change: transform;
}
.wew-gallery__main-img.is-loading {
    opacity: 0;
}

.wew-gallery__main.is-manual-zoom {
    cursor: zoom-out;
}
.wew-gallery__main.is-manual-zoom .wew-gallery__main-img {
    transform: scale(2);
}

.wew-gallery__actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 6;
}

.wew-gallery .wew-gallery__zoom-btn,
.wew-gallery .wew-gallery__lightbox-btn {
    all: unset;
    box-sizing: border-box;
    position: relative;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(17, 24, 39, 0.2) !important;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 4px 10px -8px rgba(0, 0, 0, 0.45);
    line-height: 1;
    z-index: 5;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.wew-gallery .wew-gallery__zoom-btn[aria-pressed="true"] {
    border-color: rgba(17, 24, 39, 0.45) !important;
    background: rgba(255, 255, 255, 1) !important;
}
.wew-gallery .wew-gallery__zoom-btn:hover,
.wew-gallery .wew-gallery__lightbox-btn:hover {
    background: #ffffff !important;
    border-color: rgba(17, 24, 39, 0.35) !important;
}
.wew-gallery .wew-gallery__zoom-btn svg,
.wew-gallery .wew-gallery__lightbox-btn svg {
    width: 16px;
    height: 16px;
    stroke: #111827;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
    pointer-events: none;
}

.wew-gallery .wew-gallery__nav {
    all: unset;
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(17, 24, 39, 0.2) !important;
    border-radius: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transform: translateY(-50%);
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.wew-gallery .wew-gallery__nav:hover {
    background: #ffffff !important;
    border-color: rgba(17, 24, 39, 0.35) !important;
}
.wew-gallery .wew-gallery__nav--prev {
    left: 12px;
}
.wew-gallery .wew-gallery__nav--next {
    right: 12px;
}
.wew-gallery .wew-gallery__nav[disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.wew-gallery .wew-gallery__nav svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke: #111827;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.wew-gallery-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100000;
}
.wew-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}
.wew-gallery-lightbox__img {
    display: block;
    width: auto;
    max-width: min(94vw, 1600px);
    max-height: 92vh;
    object-fit: contain;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.65);
}
.wew-gallery-lightbox__close {
    all: unset;
    position: absolute;
    top: 18px;
    right: 20px;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.wew-gallery-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}
.wew-gallery-lightbox__close svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body.wew-gallery-lightbox-open {
    overflow: hidden;
}

/* ------------------------------------------------------------------
   Thumbnails — NO borders, perfectly square
   ------------------------------------------------------------------ */
.wew-gallery__thumbs {
    display: flex;
    gap: 8px;
    scrollbar-width: none;
}
.wew-gallery__thumbs::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.wew-gallery__thumb {
    /* full reset — override any theme button styles */
    all: unset;
    display: block;
    box-sizing: border-box;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    width: var(--wew-thumb-size);
    height: var(--wew-thumb-size); /* force square */
    border-radius: 3px;
    overflow: hidden;
    background: #f5f5f5;
    /* 2px transparent border so active state doesn't cause reflow */
    border: 2px solid transparent !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.wew-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* fills the square */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.wew-gallery__thumb:hover { opacity: 0.75; }
.wew-gallery__thumb.is-active { border-color: #1a1a1a !important; }

/* ------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .wew-gallery--left {
        flex-direction: column;
    }
    .wew-gallery--left .wew-gallery__thumbs {
        order: 1; /* thumbs below on mobile */
        flex-direction: row !important;
        width: 100% !important;
        max-height: none !important;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .wew-gallery--left .wew-gallery__main {
        width: 100%;
    }
    .wew-gallery--bottom .wew-gallery__thumbs {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .wew-gallery .wew-gallery__nav {
        width: 30px;
        height: 30px;
    }
    .wew-gallery .wew-gallery__zoom-btn,
    .wew-gallery .wew-gallery__lightbox-btn {
        width: 30px;
        height: 30px;
    }
    .wew-gallery .wew-gallery__nav--prev {
        left: 8px;
    }
    .wew-gallery .wew-gallery__nav--next {
        right: 8px;
    }
    .wew-gallery__actions {
        right: 8px;
        bottom: 8px;
    }
    .wew-gallery-lightbox {
        padding: 20px;
    }
    .wew-gallery-lightbox__close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
    }
}

/* ==========================================================================
   PRODUCT TABS ACCORDION
   ========================================================================== */

.wew-accordion {
    width: 100%;
    border: 0;
    background: transparent;
}

.wew-accordion__item {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent;
    overflow: hidden;
}
.wew-accordion__item + .wew-accordion__item {
    border-top: 1px solid rgba(64, 71, 58, 0.24) !important;
}

.wew-accordion .wew-accordion__trigger {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    padding: 32px 0;
    cursor: pointer;
    margin: 0;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    color: #566349;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-bottom: 1px solid transparent;
}
.wew-accordion .wew-accordion__trigger:hover {
    background: transparent;
    color: #4d5741;
}
.wew-accordion__item.is-open .wew-accordion__trigger {
    color: #4d5741;
    border-bottom-color: rgba(64, 71, 58, 0.24);
}
.wew-accordion__trigger:focus-visible {
    outline: 2px solid #566349;
    outline-offset: 6px;
}

.wew-accordion__trigger-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.wew-accordion__tab-icon {
    display: none;
}
.wew-accordion--manual .wew-accordion__tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-right: 12px;
    box-sizing: border-box;
    color: currentColor;
}
.wew-accordion--manual .wew-accordion__tab-icon i,
.wew-accordion--manual .wew-accordion__tab-icon svg {
    display: block;
    width: 13px;
    height: 13px;
}

.wew-accordion__tab-title {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.wew-accordion__plusminus {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-left: auto;
    position: relative;
    color: #40473a;
    transition: color 0.2s ease;
}
.wew-accordion__plusminus::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -62%) rotate(45deg);
    transition: transform 0.2s ease;
}
.wew-accordion__item.is-open .wew-accordion__plusminus {
    color: #40473a;
}
.wew-accordion__item.is-open .wew-accordion__plusminus::before {
    transform: translate(-50%, -38%) rotate(-135deg);
}

.wew-accordion__body {
    overflow: hidden;
    max-height: 0;
    background: transparent;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wew-accordion__body-inner {
    padding: 4px 0 30px 0;
    color: #000000;
    font-size: 15px;
    line-height: 1.75;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.wew-accordion__item.is-open .wew-accordion__body-inner {
    padding-top: 4px;
}

@media (max-width: 767px) {
    .wew-accordion .wew-accordion__trigger {
        padding: 20px 0;
        font-size: 16px;
        line-height: 1.25;
    }
    .wew-accordion__plusminus {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }
    .wew-accordion__plusminus::before {
        width: 8px;
        height: 8px;
    }
    .wew-accordion__body-inner {
        padding: 0 0 24px 0;
        font-size: 15px;
    }
}

/* ------------------------------------------------------------------
   WooCommerce content normalisation
   ------------------------------------------------------------------ */
.wew-accordion__body-inner .woocommerce-Tabs-panel,
.wew-accordion__body-inner .panel {
    padding: 0 !important;
    border: none !important;
    background: none !important;
    margin: 0 !important;
}
.wew-accordion__body-inner h2 {
    display: none; /* WC echoes the tab title as h2 — redundant inside accordion */
}
.wew-accordion__body-inner p:first-child { margin-top: 0; }
.wew-accordion__body-inner p:last-child  { margin-bottom: 0; }

/* Attributes table */
.wew-accordion__body-inner table.shop_attributes {
    width: 100%;
    border-collapse: collapse;
    font-size: inherit;
}
.wew-accordion__body-inner table.shop_attributes th,
.wew-accordion__body-inner table.shop_attributes td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}
.wew-accordion__body-inner table.shop_attributes tr:last-child th,
.wew-accordion__body-inner table.shop_attributes tr:last-child td { border-bottom: none; }
.wew-accordion__body-inner table.shop_attributes th {
    font-weight: 600;
    color: #0f172a;
    width: 36%;
    background: #f8fafc;
}
.wew-accordion__body-inner table.shop_attributes td { color: #334155; }

/* Reviews */
.wew-accordion__body-inner .star-rating { color: #f5a623; }
.wew-accordion__body-inner .woocommerce-Reviews { margin: 0; }
.wew-accordion__body-inner #respond { margin-top: 20px; }

/* Barn2 compat */
.wew-accordion__body-inner .barn2-tabs-content { padding: 0 !important; border: none !important; }
