/* ============================================================
   WooCommerce Homepage Builder  –  front.css
   ============================================================ */

/* ── Variables ── */
.whb-wrap {
    --whb-accent:    #e8380d;
    --whb-accent-h:  #c52e09;
    --whb-border:    #e0e0e0;
    --whb-text:      #333;
    --whb-muted:     #888;
    --whb-bg:        #fff;
    --whb-sidebar-w: 210px;
    --whb-right-w:   220px;
    --whb-radius:    8px;
    --whb-shadow:    0 2px 8px rgba(0,0,0,.10);
    font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--whb-text);
    box-sizing: border-box;
}
.whb-wrap *, .whb-wrap *::before, .whb-wrap *::after { box-sizing: inherit; }

/* ── Layout ── */
.whb-wrap {
    display: grid;
    grid-template-columns: var(--whb-sidebar-w) 1fr var(--whb-right-w);
    gap: 0;
    width: 100%;
    border: 1px solid var(--whb-border);
    border-radius: var(--whb-radius);
    overflow: hidden;
    background: var(--whb-bg);
    box-shadow: var(--whb-shadow);
}

/* ════════════════════════════════
   SIDEBAR
════════════════════════════════ */
.whb-sidebar {
    border-right: 1px solid var(--whb-border);
    padding: 12px 0;
    background: #fff;
}
.whb-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    padding: 6px 18px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111;
}
.whb-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.whb-sidebar-list li a {
    display: block;
    padding: 7px 18px;
    color: #444;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: background .12s, color .12s;
    border-left: 3px solid transparent;
}
.whb-sidebar-list li a:hover {
    background: #fff5f2;
    color: var(--whb-accent);
    border-left-color: var(--whb-accent);
}
.whb-sidebar-more {
    display: block;
    padding: 8px 18px;
    color: var(--whb-accent);
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 4px;
}
.whb-sidebar-more:hover { text-decoration: underline; }

/* ════════════════════════════════
   CENTER COLUMN
════════════════════════════════ */
.whb-center {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--whb-border);
}

/* ════════════════════════════════
   HERO SLIDER
════════════════════════════════ */
.whb-slider {
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 320px;
    max-height: 420px;
    background: var(--whb-accent);
}
.whb-slides-track {
    display: flex;
    height: 100%;
    transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.whb-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 36px;
    position: relative;
    overflow: hidden;
    min-height: 320px;
}

/* Dot-grid overlay */
.whb-slide-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,.18) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.whb-slide-content {
    position: relative;
    z-index: 2;
    max-width: 60%;
}
.whb-slide-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    margin-bottom: 12px;
}
.whb-slide-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 24px;
}
.whb-slide-btn {
    display: inline-block;
    padding: 10px 24px;
    border: 2px solid #fff;
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s, color .2s;
}
.whb-slide-btn:hover {
    background: #fff;
    color: var(--whb-accent);
}

.whb-slide-image {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,.15);
    border-radius: var(--whb-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.whb-slide-image img { width: 100%; height: 100%; object-fit: cover; }

/* Slider controls */
.whb-slider-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}
.whb-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}
.whb-dot--active { background: #fff; transform: scale(1.3); }

.whb-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
    transition: background .2s;
}
.whb-slider-arrow:hover { background: rgba(255,255,255,.45); }
.whb-slider-arrow--prev { left: 10px; }
.whb-slider-arrow--next { right: 10px; }

/* ════════════════════════════════
   FEATURE BADGES
════════════════════════════════ */
.whb-badges {
    display: flex;
    border-top: 1px solid var(--whb-border);
    background: #fff;
}
.whb-badge {
    flex: 1;
    border-right: 1px solid var(--whb-border);
}
.whb-badge:last-child { border-right: none; }

.whb-badge-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 8px;
    gap: 8px;
    text-decoration: none;
    color: var(--whb-text);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background .15s;
}
.whb-badge-inner:hover { background: #fff5f2; }

.whb-badge-icon {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.whb-badge-icon img { width: 100%; height: 100%; object-fit: cover; }
.whb-badge-icon-placeholder { font-size: 22px; color: #bbb; }

.whb-badge-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #333;
    text-decoration: underline;
    text-decoration-color: #bbb;
}

/* ════════════════════════════════
   RIGHT PANEL
════════════════════════════════ */
.whb-right {
    padding: 16px 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.whb-right-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--whb-border);
}

/* Suggestions */
.whb-suggestions { display: flex; flex-direction: column; gap: 2px; }

.whb-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    text-decoration: none;
    color: var(--whb-text);
    border-radius: 6px;
    transition: background .12s;
}
.whb-suggestion-item:hover { background: #f7f7f7; }

.whb-suggestion-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e8e8e8;
}
.whb-suggestion-thumb img { width: 100%; height: 100%; object-fit: cover; }
.whb-suggestion-placeholder { font-size: 20px; color: #ccc; }

.whb-suggestion-info { display: flex; flex-direction: column; gap: 2px; }
.whb-suggestion-info strong { font-size: 13px; color: #222; font-weight: 600; line-height: 1.3; }
.whb-suggestion-info span   { font-size: 11px; color: var(--whb-muted); }

/* Request button */
.whb-request-wrap {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--whb-border);
}
.whb-no-interest {
    font-size: 12px;
    color: var(--whb-muted);
    margin: 0 0 8px;
}
.whb-request-btn {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--whb-accent);
    border-radius: 24px;
    background: #fff;
    color: var(--whb-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s, color .15s;
}
.whb-request-btn:hover {
    background: var(--whb-accent);
    color: #fff;
}

/* ════════════════════════════════
   MODALS
════════════════════════════════ */

/* FIX: [hidden] must win over display:flex */
.whb-modal[hidden],
.whb-modal-backdrop[hidden] { display: none !important; }

.whb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9990;
    animation: whb-fade-in .2s ease;
}
.whb-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9995;
    padding: 20px;
    pointer-events: none;
}
.whb-modal:not([hidden]) { pointer-events: auto; }

.whb-modal-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 32px;
    max-width: 520px;
    width: 100%;
    position: relative;
    animation: whb-slide-up .25s cubic-bezier(.4,0,.2,1);
    max-height: 90vh;
    overflow-y: auto;
}
.whb-modal-box--form { max-width: 480px; }

.whb-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 4px;
    transition: color .15s;
}
.whb-modal-close:hover { color: #333; }

.whb-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111;
}
.whb-modal-subtitle {
    font-size: 14px;
    color: var(--whb-muted);
    margin: 0 0 20px;
}
.whb-modal-body { font-size: 14px; line-height: 1.7; color: #444; }
.whb-modal-body h3 { margin-top: 0; }

/* Form */
.whb-form { display: flex; flex-direction: column; gap: 14px; }
.whb-form-row { display: flex; flex-direction: column; gap: 4px; }
.whb-form-row label { font-size: 13px; font-weight: 600; color: #444; }
.whb-form-row input,
.whb-form-row textarea {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.whb-form-row input:focus,
.whb-form-row textarea:focus {
    outline: none;
    border-color: var(--whb-accent);
    box-shadow: 0 0 0 3px rgba(232,56,13,.12);
}
.whb-form-msg {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
}
.whb-form-msg--success { background: #e8f5e9; color: #2e7d32; display: block; }
.whb-form-msg--error   { background: #fdecea; color: #c62828; display: block; }

.whb-form-submit {
    padding: 12px;
    background: var(--whb-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.whb-form-submit:hover  { background: var(--whb-accent-h); }
.whb-form-submit:active { transform: scale(.98); }
.whb-form-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Animations ── */
@keyframes whb-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes whb-slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 1024px) {
    .whb-wrap { grid-template-columns: 180px 1fr 180px; }
}
@media (max-width: 820px) {
    .whb-wrap { grid-template-columns: 1fr; }
    .whb-sidebar { border-right: none; border-bottom: 1px solid var(--whb-border); }
    .whb-sidebar-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; }
    .whb-sidebar-list li a { padding: 4px 10px; border-radius: 20px; border-left: none; background: #f4f4f4; }
    .whb-center { border-right: none; border-bottom: 1px solid var(--whb-border); }
    .whb-slide-title { font-size: 20px; }
    .whb-right { border-top: 1px solid var(--whb-border); }
}
@media (max-width: 480px) {
    .whb-badges { flex-wrap: wrap; }
    .whb-badge { flex: 0 0 50%; border-bottom: 1px solid var(--whb-border); }
    .whb-slide { padding: 20px; }
    .whb-slide-image { display: none; }
    .whb-slide-content { max-width: 100%; }
}

/* ════════════════════════════════
   FORM EXTRAS (Dokan / cotización)
════════════════════════════════ */
.whb-form-row--half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.whb-form-row--half > div { display: flex; flex-direction: column; gap: 4px; }
.whb-form-row--half label { font-size: 13px; font-weight: 600; color: #444; }
.whb-form-row--half input {
    border: 1px solid #ddd; border-radius: 6px; padding: 9px 12px;
    font-size: 14px; font-family: inherit;
    transition: border-color .15s, box-shadow .15s; width: 100%;
}
.whb-form-row--half input:focus {
    outline: none; border-color: var(--whb-accent);
    box-shadow: 0 0 0 3px rgba(232,56,13,.12);
}

.whb-form-row select {
    border: 1px solid #ddd; border-radius: 6px; padding: 9px 12px;
    font-size: 14px; font-family: inherit; width: 100%;
    background: #fff; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.whb-form-row select:focus {
    outline: none; border-color: var(--whb-accent);
    box-shadow: 0 0 0 3px rgba(232,56,13,.12);
}

.whb-field-hint {
    font-size: 11px; color: #aaa; margin-top: 3px; display: block;
}

/* Vendor preview indicator */
.whb-vendor-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff8f6;
    border: 1px solid #ffd5c8;
    border-radius: 8px;
    font-size: 13px;
    color: var(--whb-accent);
    font-weight: 600;
    animation: whb-pulse 1.2s ease-in-out infinite;
}
@keyframes whb-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .6; }
}
.whb-vp-icon { font-size: 16px; }

/* Privacy note */
.whb-form-privacy {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    margin: 4px 0 0;
}

/* Submit icon */
.whb-submit-icon { margin-right: 4px; }

@media (max-width: 480px) {
    .whb-form-row--half { grid-template-columns: 1fr; }
}

/* Input error highlight */
.whb-form-row input.whb-input-error,
.whb-form-row textarea.whb-input-error {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229,57,53,.15) !important;
    animation: whb-shake .3s ease;
}
@keyframes whb-shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}
