/* ── WQB Homepage Public Styles ──────────────────────────────────────────── */

/* ── Full-width: neutralizar wrappers de WordPress/Gutenberg ── */
.wqb-homepage-page .wqb-main > *,
.wqb-homepage-page .wqb-main .wp-block-group,
.wqb-homepage-page .wqb-main .wp-block-group__inner-container,
.wqb-homepage-page .wqb-main .is-layout-constrained,
.wqb-homepage-page .wqb-main .is-layout-flow,
.wqb-homepage-page .wqb-main .entry-content,
.wqb-homepage-page .wqb-main .wp-block-freeform {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.wqb-homepage {
    display: block;
    width: 100%;
    overflow-x: hidden;
}

/* ── Variables (set inline on .wqb-homepage) ── */
.wqb-homepage {
    --wqb-hp-accent:    #e53935;
    --wqb-hp-search-bg: #f3f4f6;
    --wqb-hp-white:     #ffffff;
    --wqb-hp-gray1:     #f8f9fa;
    --wqb-hp-gray2:     #e9ecef;
    --wqb-hp-gray3:     #6c757d;
    --wqb-hp-text:      #1d2327;
    font-family: inherit;
}

/* ── Search Bar ─────────────────────────────────────────────────────────── */
.wqb-hp-search-wrap {
    background: var(--wqb-hp-search-bg);
    padding: 14px 20px;
    border-bottom: 1px solid #e2e4e7;
}

.wqb-hp-search {
    display: flex;
    align-items: stretch;
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid var(--wqb-hp-accent);
    border-radius: 50px;
    overflow: hidden;
    height: 46px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: box-shadow .2s;
}

.wqb-hp-search:focus-within {
    box-shadow: 0 4px 20px rgba(229,57,53,.18);
}

.wqb-hp-search__cat {
    flex: 0 0 auto;
    padding: 0 14px 0 18px;
    border: none;
    background: #f8f9fa;
    font-size: 13px;
    font-weight: 500;
    color: var(--wqb-hp-text);
    cursor: pointer;
    outline: none;
    border-right: 1px solid #e2e4e7;
    max-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 28px;
}

.wqb-hp-search__sep {
    width: 1px;
    background: #e2e4e7;
    align-self: stretch;
}

.wqb-hp-search__input {
    flex: 1;
    padding: 0 16px;
    border: none;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: var(--wqb-hp-text);
    min-width: 0;
}

.wqb-hp-search__input::placeholder {
    color: #adb5bd;
}

.wqb-hp-search__btn {
    flex: 0 0 52px;
    background: var(--wqb-hp-accent);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .2s;
}

.wqb-hp-search__btn:hover {
    filter: brightness(1.1);
}

/* ── Hero Slider ────────────────────────────────────────────────────────── */
.wqb-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    user-select: none;
}

.wqb-slider--hero {
    min-height: 380px;
    max-height: 520px;
}

.wqb-slider--promo {
    min-height: 220px;
    max-height: 320px;
    margin-top: 40px;
}

.wqb-slider__track {
    display: flex;
    width: 100%;
    height: 100%;
}

.wqb-slider__slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
    min-height: inherit;
}

.wqb-slider--hero .wqb-slider__slide    { min-height: 380px; }
.wqb-slider--promo .wqb-slider__slide   { min-height: 220px; }

.wqb-slider__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

.wqb-slider__content {
    flex: 1;
    max-width: 600px;
    padding: 40px 60px;
    z-index: 2;
}

.wqb-slider__title {
    font-size: clamp(22px, 4vw, 42px);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.15;
    text-shadow: 0 2px 12px rgba(0,0,0,.18);
}

.wqb-slider__sub {
    font-size: clamp(13px, 1.5vw, 18px);
    margin: 0 0 24px;
    opacity: .9;
    max-width: 440px;
}

.wqb-slider__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wqb-slider__btn {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s, filter .2s;
    white-space: nowrap;
    display: inline-block;
}

.wqb-slider__btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.wqb-slider__btn--primary {
    background: var(--wqb-hp-accent, #e53935);
    color: #fff;
    box-shadow: 0 4px 16px rgba(229,57,53,.35);
}

.wqb-slider__btn--secondary {
    background: rgba(255,255,255,.15);
    color: inherit;
    border: 2px solid rgba(255,255,255,.5);
    backdrop-filter: blur(4px);
}

.wqb-slider__imgwrap {
    flex: 0 0 auto;
    max-width: 45%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px 40px 20px 0;
}

.wqb-slider__img {
    max-height: 340px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,.25));
}

/* Arrows */
.wqb-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.wqb-slider__arrow:hover { background: rgba(255,255,255,.35); }
.wqb-slider__arrow--prev { left: 16px; }
.wqb-slider__arrow--next { right: 16px; }

/* Dots */
.wqb-slider__dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.wqb-slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}

.wqb-slider__dot.is-active {
    background: #fff;
    transform: scale(1.4);
}

/* ── Trust Badges ───────────────────────────────────────────────────────── */
.wqb-hp-badges {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
}

.wqb-hp-badges__inner {
    max-width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.wqb-hp-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 1px solid #f0f0f0;
}

.wqb-hp-badge:last-child {
    border-right: none;
}

.wqb-hp-badge__icon {
    font-size: 28px;
    flex: 0 0 auto;
}

.wqb-hp-badge__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wqb-hp-badge__text strong {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
}

.wqb-hp-badge__text span {
    font-size: 12px;
    color: #6c757d;
}

/* ── Product Racks ──────────────────────────────────────────────────────── */
.wqb-rack {
    max-width: 100%;
    margin: 36px 0 0;
    padding: 0 28px;
}

.wqb-rack__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wqb-rack__title {
    font-size: 20px;
    font-weight: 800;
    color: #1d2327;
    margin: 0;
    border-left: 4px solid var(--wqb-hp-accent, #e53935);
    padding-left: 12px;
}

.wqb-rack__see-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--wqb-hp-accent, #e53935);
    text-decoration: none;
    transition: opacity .2s;
}

.wqb-rack__see-all:hover { opacity: .75; }

.wqb-rack__empty {
    color: #adb5bd;
    font-size: 14px;
    padding: 32px;
    text-align: center;
    border: 2px dashed #e2e4e7;
    border-radius: 8px;
}

.wqb-rack__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

/* ── Product Card ─────────────────────────────────────────────────────── */
.wqb-pcard {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}

.wqb-pcard:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.10);
    transform: translateY(-3px);
}

.wqb-pcard__img-wrap {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
}

.wqb-pcard__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform .3s;
}

.wqb-pcard:hover .wqb-pcard__img {
    transform: scale(1.06);
}

.wqb-pcard__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--wqb-hp-accent, #e53935);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    z-index: 2;
}

.wqb-pcard__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.wqb-pcard__brand {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--wqb-hp-accent, #e53935);
}

.wqb-pcard__name {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.wqb-pcard__name:hover { color: var(--wqb-hp-accent, #e53935); }

.wqb-pcard__pricing {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.wqb-pcard__price {
    font-size: 16px;
    font-weight: 800;
    color: var(--wqb-hp-accent, #e53935);
}

.wqb-pcard__old {
    font-size: 12px;
    color: #adb5bd;
    text-decoration: line-through;
}

.wqb-pcard__add-cart {
    margin-top: auto;
    padding: 8px 12px;
    background: var(--wqb-hp-accent, #e53935);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: filter .2s;
}

.wqb-pcard__add-cart:hover { filter: brightness(1.1); }

/* ── Category Grid ──────────────────────────────────────────────────────── */
.wqb-cat-grid {
    max-width: 100%;
    margin: 40px 0 0;
    padding: 0 28px;
}

.wqb-cat-grid__head {
    margin-bottom: 16px;
}

.wqb-cat-grid__title {
    font-size: 20px;
    font-weight: 800;
    color: #1d2327;
    margin: 0;
    border-left: 4px solid var(--wqb-hp-accent, #e53935);
    padding-left: 12px;
}

.wqb-cat-grid__inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.wqb-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    text-align: center;
}

.wqb-cat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.09);
    transform: translateY(-2px);
    border-color: var(--wqb-hp-accent, #e53935);
}

.wqb-cat-card__img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.wqb-cat-card__placeholder {
    font-size: 36px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.wqb-cat-card__name {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.3;
}

/* ── Brands Strip ───────────────────────────────────────────────────────── */
.wqb-brands-strip {
    max-width: 100%;
    margin: 40px 0 40px;
    padding: 0 28px;
}

.wqb-brands-strip__title {
    font-size: 20px;
    font-weight: 800;
    color: #1d2327;
    margin: 0 0 16px;
    border-left: 4px solid var(--wqb-hp-accent, #e53935);
    padding-left: 12px;
}

.wqb-brands-strip__inner {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.wqb-brand-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
    min-width: 100px;
    height: 60px;
}

.wqb-brand-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.09);
    transform: translateY(-2px);
}

.wqb-brand-card__img {
    max-height: 40px;
    max-width: 100px;
    object-fit: contain;
    filter: grayscale(1) opacity(.6);
    transition: filter .2s;
}

.wqb-brand-card:hover .wqb-brand-card__img {
    filter: grayscale(0) opacity(1);
}

.wqb-brand-card__name {
    font-size: 14px;
    font-weight: 700;
    color: #4a4a4a;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .wqb-rack__grid { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 900px) {
    .wqb-rack__grid { grid-template-columns: repeat(4, 1fr); }
    .wqb-hp-search__cat { max-width: 140px; font-size: 12px; }
    .wqb-slider--hero { min-height: 280px; }
    .wqb-slider__content { padding: 30px 30px; }
    .wqb-slider__imgwrap { display: none; }
}

@media (max-width: 640px) {
    .wqb-rack__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .wqb-hp-search__cat { display: none; }
    .wqb-hp-search__sep { display: none; }
    .wqb-hp-badges__inner { grid-template-columns: repeat(2, 1fr); }
    .wqb-hp-badge { border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
    .wqb-hp-badge:nth-child(even) { border-right: none; }
    .wqb-hp-badge:nth-last-child(-n+2) { border-bottom: none; }
    .wqb-cat-grid__inner { grid-template-columns: repeat(3, 1fr); }
    .wqb-brands-strip__inner { gap: 8px; }
    .wqb-brand-card { min-width: 80px; }

    /* Search bar */
    .wqb-hp-search-wrap { padding: 10px 14px; }
    .wqb-hp-search { height: 44px; border-radius: 10px; }
    .wqb-hp-search__input { font-size: 14px; padding: 0 12px; }
    .wqb-hp-search__btn { padding: 0 16px; font-size: 13px; border-radius: 0 10px 10px 0; }

    /* Slider */
    .wqb-slider--hero { min-height: 200px; }
    .wqb-slider__content { padding: 20px 20px 56px; }
    .wqb-slider__title { font-size: 20px; }
    .wqb-slider__subtitle { font-size: 13px; }
    .wqb-slider__btn { padding: 9px 18px; font-size: 13px; }
    .wqb-slider__arrow {
        top: auto;
        bottom: 10px;
        transform: none;
        width: 28px;
        height: 28px;
        font-size: 13px;
        background: rgba(255,255,255,.15);
        backdrop-filter: none;
    }
    .wqb-slider__arrow--prev { left: 16px; }
    .wqb-slider__arrow--next { right: 16px; }
    .wqb-slider__dots { bottom: 14px; }

    /* Section headings */
    .wqb-section-header { padding: 16px 16px 8px; }
    .wqb-section-title { font-size: 16px; }

    /* Rack cards */
    .wqb-rack { padding: 0 12px 12px; }
    .wqb-rack__grid { gap: 8px; }
}

@media (max-width: 400px) {
    .wqb-rack__grid { grid-template-columns: repeat(2, 1fr); }
    .wqb-slider__title { font-size: 17px; }
    .wqb-slider__btn { padding: 8px 14px; font-size: 12px; }
    .wqb-cat-grid__inner { grid-template-columns: repeat(2, 1fr); }
}

/* ── Admin Section Overlays ─────────────────────────────────────────────── */
/* Triggered via WP Admin Bar > "Editar Homepage" > "Ver / Ocultar Secciones" */

.wqb-hp-section {
    position: relative;
}

.wqb-hp-section__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(34, 113, 177, 0.92);
    color: #fff;
    padding: 5px 14px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

/* Show bar on hover (when sections are visible) */
.wqb-hp-section:hover .wqb-hp-section__bar {
    opacity: 1;
    pointer-events: auto;
}

/* Hide all bars when in sections-hidden mode */
.wqb-hp-sections-hidden .wqb-hp-section__bar {
    display: none !important;
}

/* Outline section on hover when bars are visible */
.wqb-homepage:not(.wqb-hp-sections-hidden) .wqb-hp-section:hover {
    outline: 2px solid rgba(34, 113, 177, 0.5);
    outline-offset: -2px;
}

.wqb-hp-section__label {
    font-weight: 600;
}

.wqb-hp-section__edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 11px;
    background: rgba(255,255,255,.15);
    padding: 3px 10px;
    border-radius: 20px;
    transition: background .15s;
}
.wqb-hp-section__edit:hover {
    background: rgba(255,255,255,.28);
    color: #fff;
}
.wqb-hp-section__edit .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

/* ── YouTube Block ───────────────────────────────────────────────────────── */
.wqb-yt-block {
    padding: 40px 28px;
    background: #111;
    text-align: center;
}

.wqb-yt-block--none { padding: 0; }
.wqb-yt-block--large { padding: 60px 28px; }

.wqb-yt-block__title {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 20px;
}

.wqb-yt-block__embed {
    max-width: 900px;
    margin: 0 auto;
}

.wqb-yt-block__ratio {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.wqb-yt-block__ratio iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.wqb-yt-block__caption {
    color: rgba(255,255,255,.65);
    font-size: 13px;
    margin: 14px 0 0;
}

/* ── Image Banner Block ──────────────────────────────────────────────────── */
.wqb-img-banner {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.wqb-img-banner__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 40px;
}

.wqb-img-banner__title {
    font-size: clamp(22px, 4vw, 44px);
    font-weight: 800;
    margin: 0 0 12px;
    text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.wqb-img-banner__text {
    font-size: clamp(14px, 2vw, 18px);
    margin: 0 0 20px;
    max-width: 600px;
    opacity: .9;
}

.wqb-img-banner__btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--wqb-hp-accent, #e53935);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: filter .2s, transform .2s;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.wqb-img-banner__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    color: #fff;
}

.wqb-img-banner__fulllink {
    position: absolute;
    inset: 0;
    z-index: 5;
}
.wqb-img-banner__overlay { z-index: 6; }

/* ── Text + Image Block ──────────────────────────────────────────────────── */
.wqb-ti-block {
    padding: 48px 28px;
}

.wqb-ti-block--large { padding: 72px 28px; }

.wqb-ti-block__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.wqb-ti-block__title {
    font-size: clamp(22px, 3vw, 36px);
    font-weight: 800;
    margin: 0 0 16px;
    line-height: 1.2;
}

.wqb-ti-block__content {
    font-size: 16px;
    line-height: 1.7;
    opacity: .85;
    margin: 0 0 24px;
}
.wqb-ti-block__content p { margin: 0 0 12px; }
.wqb-ti-block__content p:last-child { margin-bottom: 0; }

.wqb-ti-block__btn {
    display: inline-block;
    padding: 11px 28px;
    background: var(--wqb-hp-accent, #e53935);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: filter .2s, transform .2s;
}
.wqb-ti-block__btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    color: #fff;
}

.wqb-ti-block__img img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    object-fit: cover;
}

@media (max-width: 768px) {
    .wqb-ti-block__inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .wqb-ti-block--left .wqb-ti-block__img,
    .wqb-ti-block--right .wqb-ti-block__img {
        order: -1;
    }
    .wqb-img-banner__overlay { padding: 24px 20px; }
    .wqb-img-banner__title { font-size: 22px; }
    .wqb-yt-block { padding: 28px 16px; }
    .wqb-ti-block { padding: 32px 16px; }
}
