/* =============================================
   Wooden Sheds Online — Homepage
   ============================================= */

.ws-homepage {
    --ws-hp-green: var(--ws-primary, #2d7a3a);
    --ws-hp-dark: var(--ws-ink, #1a1a1a);
    --ws-hp-text: var(--ws-ink, #333);
    --ws-hp-muted: var(--ws-muted, #666);
    --ws-hp-border: var(--ws-border, #e5e5e0);
    --ws-hp-radius: 8px;
    --ws-hp-max: 1400px;
}

/* ── Section heading ── */

.ws-hp-section-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--ws-hp-dark);
    margin: 0 0 24px;
    text-align: center;
}

/* ══════════════════════════════════════
   1. HERO SLIDER
   ══════════════════════════════════════ */

.ws-hp-hero {
    position: relative;
    overflow: hidden;
    background: var(--ws-hp-dark);
}

.ws-hp-hero__slider {
    position: relative;
}

.ws-hp-hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.ws-hp-hero__slide.is-active {
    position: relative;
    opacity: 1;
}

.ws-hp-hero__slide img {
    width: 100%;
    height: var(--ws-hp-hero-h, 500px) !important;
    max-height: var(--ws-hp-hero-h, 500px) !important;
    object-fit: cover;
    display: block;
}

.ws-hp-hero__content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 48px 80px;
    background: linear-gradient(to right, rgba(0,0,0,0.55) 40%, transparent 80%);
}

.ws-hp-hero__inner {
    max-width: 550px;
    color: #fff;
}

.ws-hp-hero__heading {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 12px;
    color: #fff;
}

.ws-hp-hero__sub {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 12px;
    opacity: 0.9;
}

.ws-hp-hero__promo {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.ws-hp-hero__promo strong {
    background: #F5C518;
    color: #333;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.ws-hp-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: var(--ws-hp-green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--ws-hp-radius);
    text-decoration: none;
    transition: background 0.2s;
}

.ws-hp-hero__cta:hover {
    background: #245f2e;
    color: #fff;
}

.ws-hp-hero__badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #F5C518;
    color: #333;
    font-size: 22px;
    font-weight: 700;
    padding: 16px 20px;
    border-radius: 8px;
    text-align: center;
    line-height: 1.1;
}

/* Arrows */
.ws-hp-hero__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 0;
    line-height: 1;
}

.ws-hp-hero__arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ws-hp-hero__arrow--prev { left: 20px; }
.ws-hp-hero__arrow--next { right: 20px; }

@media (max-width: 768px) {
    .ws-hp-hero__arrow { width: 36px; height: 36px; font-size: 20px; }
    .ws-hp-hero__arrow--prev { left: 12px; }
    .ws-hp-hero__arrow--next { right: 12px; }
}

/* Dots */
.ws-hp-hero__dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.ws-hp-hero__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.ws-hp-hero__dot.is-active {
    background: #fff;
}

/* ══════════════════════════════════════
   2. TRUST BAR
   ══════════════════════════════════════ */

.ws-hp-trust {
    padding: 48px 24px;
    background: #fff;
}

.ws-hp-trust__inner {
    max-width: var(--ws-hp-max);
    margin: 0 auto;
    text-align: center;
}

.ws-hp-trust__headline {
    font-size: 24px;
    font-weight: 700;
    color: var(--ws-hp-dark);
    margin: 0 0 24px;
}

.ws-hp-trust__widget {
    margin-bottom: 32px;
}

.ws-hp-trust__reviews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    text-align: left;
}

.ws-hp-trust__review {
    background: #f8f8f6;
    border-radius: var(--ws-hp-radius);
    padding: 20px;
}

.ws-hp-trust__stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.ws-hp-trust__star {
    color: #00b67a;
    font-size: 16px;
}

.ws-hp-trust__verified {
    font-size: 11px;
    font-weight: 600;
    color: #00b67a;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ws-hp-trust__review-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ws-hp-text);
    margin: 0 0 8px;
}

.ws-hp-trust__reviewer {
    font-size: 12px;
    color: var(--ws-hp-muted);
}

/* ══════════════════════════════════════
   3. PRODUCT CARDS & CAROUSEL
   ══════════════════════════════════════ */

.ws-hp-products {
    padding: 48px 24px;
    background: #fff;
}

.ws-hp-products__inner {
    max-width: var(--ws-hp-max);
    margin: 0 auto;
}

.ws-hp-products__carousel {
    position: relative;
    overflow: hidden;
}

.ws-hp-products__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.ws-hp-products__track::-webkit-scrollbar {
    display: none;
}

/* Product card — matches category tile UI */
.ws-hp-card {
    flex: 0 0 calc(25% - 15px);
    min-width: 200px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e0e4d8;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
}

.ws-hp-card:hover {
    box-shadow: 0 8px 28px rgba(13, 26, 11, 0.1);
    transform: translateY(-2px);
}

.ws-hp-card__link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.ws-hp-card__image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    margin: 10px 10px 0;
    border-radius: 10px;
}

.ws-hp-card__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ws-hp-card__link:hover .ws-hp-card__image-wrap img {
    transform: scale(1.05);
}

/* Badge — positioned top-right like category tiles */
.ws-hp-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-radius: 6px;
    z-index: 10;
}

.ws-hp-card__badge--green {
    background: #e4f4d8;
    color: #2f6120;
}

.ws-hp-card__badge--dark {
    background: #0d1a0b;
    color: #74bb52;
}

.ws-hp-card__badge--amber {
    background: #fef3c7;
    color: #92400e;
}

.ws-hp-card__badge--red {
    background: #fee2e2;
    color: #991b1b;
}

.ws-hp-card__badge--blue {
    background: #dbeafe;
    color: #1e40af;
}

.ws-hp-card__info {
    padding: 14px 16px 8px;
}

.ws-hp-card__name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
    line-height: 1.3;
}

.ws-hp-card__name a {
    color: inherit;
    text-decoration: none;
}

/* Now / Was price */
.ws-hp-card__price {
    margin-bottom: 8px;
    line-height: 1.4;
}

.ws-hp-card__price .ws-tile-price__now {
    font-size: 20px;
    font-weight: 800;
    color: #b91c1c;
}

.ws-hp-card__price .ws-tile-price__now .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.ws-hp-card__price .ws-tile-price__now sup {
    font-size: 12px;
    vertical-align: super;
    font-weight: 600;
}

.ws-hp-card__price .ws-tile-price__was {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.ws-hp-card__price .ws-tile-price__was .woocommerce-Price-amount {
    font-size: inherit;
    color: inherit;
}

.ws-hp-card__price .ws-tile-price__was sup {
    font-size: 10px;
    vertical-align: super;
}

/* Star rating */
.ws-hp-card__rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 10px;
}

.ws-hp-card__star {
    color: #ddd;
    font-size: 15px;
}

.ws-hp-card__star.is-filled {
    color: #F5C518;
}

.ws-hp-card__review-count {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-left: 4px;
}

/* Gallery thumbs inside card — reuse tile styles */
.ws-hp-card .ws-tile-gallery {
    padding: 0;
    margin-bottom: 10px;
}

/* Two-button footer */
.ws-hp-card__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 16px 16px;
}

/* Carousel arrows (injected by JS) */
.ws-hp-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-70%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--ws-hp-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: box-shadow 0.15s;
    color: var(--ws-hp-dark);
}

.ws-hp-carousel__arrow:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.ws-hp-carousel__arrow--prev {
    left: -8px;
}

.ws-hp-carousel__arrow--next {
    right: -8px;
}

@media (max-width: 768px) {
    .ws-hp-carousel__arrow {
        width: 32px;
        height: 32px;
    }
    .ws-hp-carousel__arrow--prev { left: 4px; }
    .ws-hp-carousel__arrow--next { right: 4px; }
}

/* Arrows-top layout: heading left, arrows top-right */
.ws-hp-products__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ws-hp-products__header-row .ws-hp-section-heading {
    margin: 0;
    text-align: left;
}

.ws-hp-carousel__arrows-top {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ws-hp-carousel__arrows-top .ws-hp-carousel__arrow {
    position: static;
    transform: none;
}

/* Hide the overlay arrows when using top arrows */
.ws-hp-products__carousel--arrows-top > .ws-hp-carousel__arrow {
    display: none !important;
}

/* Desktop CTA button next to arrows */
.ws-hp-carousel__cta-desktop {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #2f6120;
    border: 1px solid #2f6120;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.ws-hp-carousel__cta-desktop:hover {
    background: #2f6120;
    color: #fff;
}

/* When below carousel (centre/right aligned heading) */
.ws-hp-carousel__cta-desktop--below {
    display: block;
    text-align: center;
    margin: 20px auto 0;
    width: fit-content;
}

/* Mobile CTA — centred below products, hidden on desktop */
.ws-hp-products__cta-mobile {
    display: none;
    text-align: center;
    margin-top: 20px;
}

/* ══════════════════════════════════════
   4. PROMO BANNER
   ══════════════════════════════════════ */

.ws-hp-promo {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.ws-hp-promo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}

.ws-hp-promo--dark::before {
    background: rgba(0,0,0,0.5);
}

.ws-hp-promo__inner {
    position: relative;
    z-index: 1;
    max-width: var(--ws-hp-max);
    margin: 0 auto;
    padding: 48px 40px;
    width: 100%;
}

.ws-hp-promo--white {
    color: #fff;
}

.ws-hp-promo--dark .ws-hp-promo__inner {
    color: var(--ws-hp-dark);
}

.ws-hp-promo__eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.ws-hp-promo__heading {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px;
    max-width: 500px;
}

.ws-hp-promo__sub {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px;
    max-width: 500px;
    opacity: 0.9;
}

/* ── CTA button ── */

.ws-hp-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: var(--ws-hp-green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--ws-hp-radius);
    text-decoration: none;
    transition: background 0.2s;
    border: 2px solid var(--ws-hp-green);
}

.ws-hp-cta:hover {
    background: #245f2e;
    border-color: #245f2e;
    color: #fff;
}

.ws-hp-cta--outline {
    background: transparent;
    border-color: currentColor;
}

.ws-hp-cta--outline:hover {
    background: #fff;
    color: var(--ws-hp-green);
    border-color: #fff;
}

/* ══════════════════════════════════════
   5. THREE GRID TILES
   ══════════════════════════════════════ */

.ws-hp-three-grid {
    padding: 48px 24px;
}

.ws-hp-three-grid__inner {
    max-width: var(--ws-hp-max);
    margin: 0 auto;
}

.ws-hp-three-grid__tiles {
    display: grid;
    gap: 20px;
}

.ws-hp-three-grid__tiles--3 {
    grid-template-columns: repeat(3, 1fr);
}

.ws-hp-three-grid__tiles--2 {
    grid-template-columns: repeat(2, 1fr);
}

.ws-hp-three-grid__tile {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    max-height: 450px;
    width: 100%;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ws-hp-three-grid__tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.ws-hp-three-grid__tile img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.4s;
}

.ws-hp-three-grid__tile:hover img {
    transform: scale(1.05);
}

.ws-hp-three-grid__label {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    padding: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Dark overlay for text legibility */
.ws-hp-three-grid__tile::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    transition: background 0.3s;
}

.ws-hp-three-grid__tile:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .ws-hp-three-grid__tiles {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ws-hp-three-grid__tile {
        aspect-ratio: 16 / 9;
    }

    .ws-hp-three-grid__label {
        font-size: 20px;
    }
}

/* ══════════════════════════════════════
   6. TRADE BANNER
   ══════════════════════════════════════ */

.ws-hp-trade {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}

.ws-hp-trade::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.ws-hp-trade__inner {
    position: relative;
    z-index: 1;
    max-width: var(--ws-hp-max);
    margin: 0 auto;
    padding: 48px 40px;
    width: 100%;
}

.ws-hp-trade__heading {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}

.ws-hp-trade__body {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px;
    max-width: 550px;
    opacity: 0.9;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .ws-hp-hero__slide img {
        height: var(--ws-hp-hero-h-mobile, 350px);
    }

    .ws-hp-hero__content {
        padding: 24px;
        align-items: flex-end;
        background: linear-gradient(to top, rgba(0,0,0,0.65) 60%, transparent);
    }

    .ws-hp-hero__heading {
        font-size: 24px;
    }

    .ws-hp-hero__sub {
        font-size: 14px;
    }

    .ws-hp-hero__badge {
        top: 12px;
        right: 12px;
        font-size: 16px;
        padding: 10px 14px;
    }

    .ws-hp-section-heading {
        font-size: 22px;
    }

    .ws-hp-trust__reviews {
        grid-template-columns: 1fr;
    }

    .ws-hp-products__track {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        overflow-x: visible;
        scroll-snap-type: none;
    }

    .ws-hp-card {
        flex: none;
        min-width: 0;
    }

    /* Hide carousel arrows on mobile since it's a grid now */
    .ws-hp-carousel__arrow,
    .ws-hp-carousel__arrows-top,
    .ws-hp-carousel__cta-desktop {
        display: none !important;
    }

    /* Show mobile CTA */
    .ws-hp-products__cta-mobile {
        display: block;
    }

    .ws-hp-card__name {
        font-size: 13px;
    }

    .ws-hp-card__info {
        padding: 10px 12px 6px;
    }

    .ws-hp-card__footer {
        padding: 0 12px 12px;
    }

    .ws-hp-card__btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .ws-hp-promo {
        min-height: 280px;
    }

    .ws-hp-promo__heading {
        font-size: 24px;
    }

    .ws-hp-promo__inner,
    .ws-hp-trade__inner {
        padding: 32px 24px;
    }

    .ws-hp-trade__heading {
        font-size: 24px;
    }
}
