/* =========================================================
   World Jerseys Enhancements — Styles
   ========================================================= */

/* ─── 1. SHIPPING ACCORDION ─────────────────────────────── */
.wje-shipping-accordion {
    margin: 20px 0 10px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff !important;
    padding: 0 4px;
    border-radius: 6px;
}

/* Force child elements to be transparent so the white container shows through */
.wje-shipping-accordion *,
.wje-money-back * {
    background-color: transparent !important;
}

/* Force all text dark regardless of theme colour scheme */
.wje-shipping-accordion,
.wje-shipping-accordion *,
.wje-money-back,
.wje-money-back * {
    color: #111827 !important;
}

.wje-accordion-item {
    border-bottom: 1px solid #e5e7eb;
}

.wje-accordion-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 4px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    gap: 10px;
    transition: background 0.15s;
}

.wje-accordion-trigger:hover {
    background: #f9fafb !important;
}

.wje-accordion-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #4b5563;
    display: flex;
    align-items: center;
}

.wje-accordion-icon svg {
    width: 22px;
    height: 22px;
}

.wje-accordion-title {
    flex: 1;
    font-size: 13.5px;
    letter-spacing: 0.01em;
}

.wje-accordion-chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #9ca3af;
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
}

.wje-accordion-chevron svg {
    width: 18px;
    height: 18px;
}

.wje-accordion-trigger[aria-expanded="true"] .wje-accordion-chevron {
    transform: rotate(180deg);
}

.wje-accordion-trigger[aria-expanded="true"] .wje-accordion-icon {
    color: #111827;
}

.wje-accordion-panel {
    overflow: hidden;
}

.wje-accordion-panel[hidden] {
    display: none;
}

.wje-accordion-panel-inner {
    padding: 4px 4px 16px 36px;
    font-size: 13px;
    line-height: 1.65;
    color: #374151;
}

.wje-accordion-panel-inner p {
    margin: 0 0 8px;
}

.wje-accordion-panel-inner a {
    color: #111827;
    text-decoration: underline;
}

/* Money-back guarantee badge */
.wje-money-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 4px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.wje-money-back svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #374151;
}

/* ─── 2. FOOTER LOGOS ────────────────────────────────────── */
.wje-footer-logos {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 22px 20px;
    text-align: center;
}

.wje-footer-logos-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Each row: label + logos side by side */
.wje-logos-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.wje-logos-label {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}

.wje-delivery-logos,
.wje-payment-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

/* Delivery company logos — no badge/card styling, let them render naturally */
.wje-delivery-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* UPS shield is taller than wide, so constrain height */
.wje-logo-ups {
    height: 56px;
    width: auto;
}

/* FedEx is wide — give it more horizontal room */
.wje-logo-fedex {
    height: 38px;
    width: auto;
    max-width: 130px;
}

/* Payment icons — use WooCommerce official SVGs, uniform height */
.wje-payment-logos img {
    height: 34px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0.9;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

.wje-payment-logos img:hover {
    opacity: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* ─── 3. REVIEWS SECTION ─────────────────────────────────── */
.wje-reviews-section {
    background: #fff;
    padding: 60px 20px;
    margin-top: 0;
}

.wje-reviews-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.wje-reviews-heading {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #111827;
    margin: 0 0 16px;
}

.wje-reviews-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}

.wje-reviews-avg {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.wje-reviews-count {
    font-size: 15px;
    color: #6b7280;
}

/* Star rating */
.wje-stars {
    display: flex;
    gap: 3px;
}

.wje-star {
    width: 20px;
    height: 20px;
    fill: #d1d5db;
    stroke: none;
}

.wje-star.filled {
    fill: #111827;
}

.wje-reviews-summary .wje-stars .wje-star {
    width: 28px;
    height: 28px;
}

/* Reviews grid */
.wje-reviews-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .wje-reviews-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wje-reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .wje-reviews-heading {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .wje-reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* Review card */
.wje-review-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    overflow: hidden;
}

/* Review card image */
.wje-review-image {
    margin: -16px -16px 8px -16px;
}

.wje-review-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.wje-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.wje-review-author {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.wje-review-date {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.wje-review-text {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.5;
}

.wje-review-product {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.wje-review-product img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.wje-review-product span {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* ─── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 768px) {
    .wje-footer-logos {
        padding: 18px 16px;
    }
    .wje-logos-row {
        flex-direction: column;
        gap: 8px;
    }
    .wje-logos-label {
        text-align: center;
        min-width: auto;
    }
    .wje-delivery-logos {
        gap: 10px;
    }
    .wje-delivery-logo {
        height: 36px;
        width: auto;
    }
    .wje-logo-ups {
        height: 42px;
    }
    .wje-logo-fedex {
        height: 28px;
        max-width: 100px;
    }
    .wje-reviews-section {
        padding: 40px 16px;
    }
}

/* ─── Checkout: Hide Express Checkout on Blocks checkout ── */
.wc-block-components-express-payment,
.wc-block-components-express-payment-continue-rule {
    display: none !important;
}

/* ─── Checkout: USA country error notice ─────────────────── */
.wje-country-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1.5px solid #f87171;
    border-left: 5px solid #ef4444;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 0 0 24px;
    font-size: 14px;
    font-weight: 600;
    color: #b91c1c;
    line-height: 1.5;
}

.wje-country-error span {
    flex: 1;
}

/* ─── Footer: Custom accordion (Quick Links / Policy) ───── */

/* Hidden on desktop — only shown on mobile */
.wje-footer-accordion-section {
    display: none;
}

/* Copyright hidden on desktop (Blocksy handles it there) */
.wje-footer-copyright {
    display: none;
}

@media (max-width: 768px) {
    /* Show our custom accordion — force WHITE background over any theme styles */
    .wje-footer-accordion-section {
        display: block !important;
        background: #ffffff !important;
        background-color: #ffffff !important;
        padding: 0 20px !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    /* Force all children to also have white/transparent bg so theme dark colours don't bleed */
    .wje-footer-accordion-section,
    .wje-footer-accordion-section * {
        color: #111827 !important;
        background-color: transparent !important;
    }

    /* Re-apply white only on the section container itself */
    .wje-footer-accordion-section {
        background-color: #ffffff !important;
    }

    /* Hide Elementor-built footer columns on mobile (our accordion replaces them).
       The Elementor footer uses .elementor-inner-section / [data-element_type] attrs.
       Also covers standard Blocksy widget classes as a fallback. */
    footer .elementor-section,
    footer .elementor-inner-section,
    footer [data-element_type="section"],
    footer [data-element_type="column"],
    footer .elementor-row,
    footer .ct-footer-widgets-area,
    footer .ct-footer-top,
    footer .ct-footer-bottom,
    footer .ct-footer-row {
        display: none !important;
    }

    /* Collapse footer wrapper spacing */
    footer.ct-footer,
    footer {
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
    }

    /* Accordion item divider */
    .wje-cfa-item {
        border-bottom: 1px solid #e5e7eb !important;
    }

    .wje-cfa-item:last-child {
        border-bottom: none !important;
    }

    /* Trigger button */
    .wje-cfa-trigger {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        border: none !important;
        padding: 16px 0 !important;
        cursor: pointer !important;
        text-align: left !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #111827 !important;
        gap: 10px !important;
        user-select: none !important;
    }

    /* Chevron */
    .wje-cfa-chevron {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        transition: transform 0.25s ease !important;
        color: #9ca3af !important;
    }

    .wje-cfa-trigger[aria-expanded="true"] .wje-cfa-chevron {
        transform: rotate(180deg) !important;
        color: #374151 !important;
    }

    /* Panel content */
    .wje-cfa-panel {
        padding-bottom: 14px !important;
    }

    .wje-cfa-panel ul {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .wje-cfa-panel ul li {
        padding: 3px 0 !important;
    }

    .wje-cfa-panel ul li a {
        font-size: 13px !important;
        color: #374151 !important;
        text-decoration: none !important;
        display: block !important;
        padding: 5px 0 !important;
    }

    .wje-cfa-panel ul li a:hover {
        color: #111827 !important;
    }

    /* Copyright below logos on mobile */
    .wje-footer-copyright {
        display: block !important;
        text-align: center !important;
        font-size: 12px !important;
        color: #9ca3af !important;
        margin: 0 !important;
        padding: 12px 0 4px !important;
        border-top: 1px solid #e5e7eb !important;
        width: 100% !important;
    }
}

/* ─── Footer bottom bar (copyright + policy links) ─────── */
/* Moved by JS to appear after .wje-footer-logos on desktop  */

.wje-footer-bottom-bar {
    background: #f9fafb !important;
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb !important;
    padding: 14px 24px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove Elementor's background overlay (keeps the theme dark tint) */
.wje-footer-bottom-bar .elementor-background-overlay {
    display: none !important;
}

/* Reset all text and link colours inside the bar */
.wje-footer-bottom-bar,
.wje-footer-bottom-bar * {
    background-color: transparent !important;
    color: #6b7280 !important;
}

.wje-footer-bottom-bar a {
    color: #374151 !important;
    text-decoration: none !important;
}

.wje-footer-bottom-bar a:hover {
    color: #111827 !important;
    text-decoration: underline !important;
}

/* Hide the moved bottom bar on mobile — our .wje-footer-copyright handles it */
@media (max-width: 768px) {
    .wje-footer-bottom-bar {
        display: none !important;
    }
}

/* ─── Sticky add-to-cart bar (mobile only) ──────────────── */
.wje-sticky-bar {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .wje-sticky-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
        transform: translateY(100%);
        transition: transform 0.3s ease;
        padding: env(safe-area-inset-bottom, 0) 0 0; /* iPhone notch */
    }

    .wje-sticky-bar.wje-sticky-visible {
        transform: translateY(0);
    }

    .wje-sticky-inner {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
    }

    /* Product thumbnail + name/price */
    .wje-sticky-product {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .wje-sticky-thumb img {
        width: 44px;
        height: 44px;
        object-fit: cover;
        border-radius: 4px;
        border: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    .wje-sticky-meta {
        min-width: 0;
    }

    .wje-sticky-name {
        font-size: 12px;
        font-weight: 600;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.3;
    }

    .wje-sticky-price {
        font-size: 13px;
        font-weight: 700;
        color: #111827;
        line-height: 1.3;
    }

    .wje-sticky-price .woocommerce-Price-amount {
        font-weight: 700;
    }

    /* Buttons */
    .wje-sticky-buttons {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .wje-sticky-btn {
        padding: 10px 14px;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
        line-height: 1;
        transition: opacity 0.2s;
    }

    .wje-sticky-btn:active {
        opacity: 0.85;
    }

    .wje-sticky-add {
        background: #111827;
        color: #fff;
    }

    .wje-sticky-buy {
        background: #F05A28;
        color: #fff;
    }

    .wje-sticky-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    /* Prevent content from being hidden behind sticky bar */
    body.single-product {
        padding-bottom: 70px;
    }
}
