/* Vertex Visual Search — Frontend Styles (WoodMart uyumlu) */

/* ── Trigger button (header / search form) ────────────────────────────── */
.vvs-trigger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--woodmart-primary-color, #333);
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.vvs-trigger-btn:hover,
.vvs-trigger-btn:focus {
    color: var(--woodmart-accent-color, #764a20);
    background: rgba(0, 0, 0, 0.06);
    outline: none;
}

.vvs-trigger-btn svg {
    width: 22px;
    height: 22px;
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.vvs-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.vvs-modal[hidden] {
    display: none;
}

.vvs-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

body.vvs-modal-open {
    overflow: hidden;
}

.vvs-modal__container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    animation: vvsSlideIn 0.22s ease;
}

@keyframes vvsSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.vvs-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.vvs-modal__title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    flex: 1;
    min-width: 0;
}


.vvs-modal__footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.vvs-modal__footer-close {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-align: center;
}

.vvs-modal__footer-close:hover {
    background: #e8e8e8;
    color: #222;
}

/* ── Dropzone ─────────────────────────────────────────────────────────── */
.vvs-dropzone {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
    margin-bottom: 20px;
}

.vvs-dropzone:hover,
.vvs-dropzone--active {
    border-color: var(--woodmart-accent-color, #764a20);
    background: rgba(118, 74, 32, 0.04);
}

.vvs-dropzone__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.vvs-dropzone__icon {
    margin-bottom: 12px;
    color: #aaa;
}

.vvs-dropzone__icon svg {
    width: 48px;
    height: 48px;
}

.vvs-dropzone__hint {
    margin: 0 0 6px;
    font-weight: 600;
    color: #333;
}

.vvs-dropzone__sub {
    margin: 0;
    font-size: 0.83rem;
    color: #888;
}

/* ── Nesne Seçimi ─────────────────────────────────────────────────────── */
#vvs-selection-step[hidden] {
    display: none;
}

.vvs-selection-hint {
    font-size: 0.88rem;
    color: #444;
    font-weight: 600;
    text-align: center;
    margin: 0 0 14px;
}

.vvs-selection-loader[hidden] {
    display: none;
}

.vvs-selection-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.vvs-selection-loader--inline {
    padding: 24px 0;
}

.vvs-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: var(--woodmart-accent-color, #764a20);
    border-radius: 50%;
    animation: vvsSpin 0.8s linear infinite;
}

/* ── Görsel Kart Izgarası ─────────────────────────────────────────────── */
.vvs-object-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.vvs-object-card {
    position: relative;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #f4f4f4;
    padding: 0;
    aspect-ratio: 1 / 1;
    display: block;
    width: 100%;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
}

.vvs-object-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

.vvs-object-card:hover:not( :disabled) {
    border-color: var(--woodmart-accent-color, #764a20);
    box-shadow: 0 4px 16px rgba(118, 74, 32, 0.35);
    transform: scale(1.04);
}

.vvs-object-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.vvs-object-card--searching {
    opacity: 1 !important;
    transform: none !important;
    cursor: default;
    border-color: var(--woodmart-accent-color, #764a20) !important;
    animation: vvsGlowPulse 2s ease-in-out infinite;
}

/* Tarama dokusu — CRT çizgi efekti + hafif karartma */
.vvs-object-card--searching::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.10) 2px,
            rgba(0, 0, 0, 0.10) 4px),
        rgba(0, 0, 0, 0.18);
    z-index: 1;
    pointer-events: none;
}

/* Yeşil tarama ışığı — yukarıdan aşağıya süpürür */
.vvs-object-card--searching::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    top: -100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(118, 74, 32, 0.06) 25%,
            rgba(118, 74, 32, 0.22) 62%,
            rgba(170, 108, 50, 0.58) 84%,
            rgba(255, 255, 255, 0.90) 95%,
            rgba(195, 130, 65, 0.60) 100%);
    animation: vvsScanLine 1.8s linear infinite;
    z-index: 2;
    pointer-events: none;
}

@keyframes vvsGlowPulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(118, 74, 32, 0.45), 0 0 14px rgba(118, 74, 32, 0.20);
    }

    50% {
        box-shadow: 0 0 0 2px rgba(118, 74, 32, 0.90), 0 0 26px rgba(118, 74, 32, 0.55);
    }
}

@keyframes vvsScanLine {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

.vvs-object-card--full {
    border-color: #c8d8ff;
    background: #f4f7ff;
    position: relative;
}

.vvs-object-card--full:hover:not( :disabled) {
    border-color: #5b8ff9;
    box-shadow: 0 4px 16px rgba(91, 143, 249, 0.3);
}

.vvs-card-label {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #5b8ff9;
    background: rgba(255, 255, 255, 0.85);
    padding: 1px 0;
    pointer-events: none;
}

.vvs-selection-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.vvs-preview__change {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
}

.vvs-preview__change:hover {
    background: #eee;
    border-color: #ccc;
}

/* ── Button ───────────────────────────────────────────────────────────── */
.vvs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.vvs-btn--primary {
    background: var(--woodmart-accent-color, #764a20);
    color: #fff;
}

.vvs-btn--primary:hover:not( :disabled) {
    opacity: 0.88;
}

.vvs-btn--primary:active:not( :disabled) {
    transform: scale(0.98);
}

.vvs-btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.vvs-btn__spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vvsSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes vvsSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Results ──────────────────────────────────────────────────────────── */
.vvs-results {
    margin-top: 24px;
}

.vvs-results[hidden] {
    display: none;
}

.vvs-results__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
    color: #333;
}

.vvs-results__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 480px) {
    .vvs-results__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Product card ─────────────────────────────────────────────────────── */
.vvs-product-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.vvs-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.vvs-product-card__img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f9f9f9;
}

.vvs-product-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vvs-product-card:hover .vvs-product-card__img img {
    transform: scale(1.05);
}

.vvs-score-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.vvs-product-card__body {
    padding: 10px;
}

.vvs-product-card__name {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.35;
}

.vvs-product-card__name a {
    color: #222;
    text-decoration: none;
}

.vvs-product-card__name a:hover {
    color: var(--woodmart-accent-color, #764a20);
}

.vvs-product-card__price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--woodmart-accent-color, #764a20);
    margin-bottom: 8px;
}

.vvs-product-card__cart {
    display: block;
    text-align: center;
    padding: 7px 10px;
    background: #111;
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.vvs-product-card__cart:hover {
    background: var(--woodmart-accent-color, #764a20);
}

/* ── Mobile nav row / menu item ───────────────────────────────────────── */

/* wp_nav_menu_items ile eklenen <li> — masaüstü navlarda gizle */
li.vvs-mobile-menu-item {
    display: none !important;
    list-style: none;
}

/* WoodMart mobil sidebar içinde göster */
#woodmart-menu-sidebar li.vvs-mobile-menu-item,
.wd-side-panel li.vvs-mobile-menu-item,
.woodmart-navigation.mobile-nav li.vvs-mobile-menu-item,
.woodmart-navigation.hamburger-nav li.vvs-mobile-menu-item,
.wd-nav-mobile li.vvs-mobile-menu-item,
.mobile-nav li.vvs-mobile-menu-item,
.wd-side-hidden li.vvs-mobile-menu-item {
    display: block !important;
    padding: 0;
}

/* ── Mobile trigger button ────────────────────────────────────────────── */
.vvs-mobile-nav-row {
    padding: 8px 16px;
    display: flex;
    justify-content: center;
}

.vvs-mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.vvs-mobile-trigger:hover,
.vvs-mobile-trigger:focus {
    background: transparent;
    outline: none;
    box-shadow: none;
}

/* Renkli ikon kutusu */
.vvs-mobile-trigger__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--woodmart-accent-color, #764a20);
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.18s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(118, 74, 32, 0.3);
}

.vvs-mobile-trigger:hover .vvs-mobile-trigger__icon,
.vvs-mobile-trigger:focus .vvs-mobile-trigger__icon {
    background: #111;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.vvs-mobile-trigger__icon svg {
    width: 22px;
    height: 22px;
}

/* ── Hidden product (WoodMart DOM filtreleme) ────────────────────────── */
.vvs-hidden-product {
    display: none !important;
}

/* ── Visual search results notice (shop page) ────────────────────────── */
.vvs-results-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0f7ff;
    border: 1px solid #bee3f8;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 0.9rem;
    color: #2c5f8a;
    flex-wrap: wrap;
    width: 100%;
}

.vvs-results-notice svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.vvs-results-notice__label {
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.vvs-results-notice__back {
    color: #2c5f8a;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    padding: 5px 12px;
    transition: background 0.2s;
}

.vvs-results-notice__back:hover {
    background: #dbeafe;
}

.vvs-results-notice__new {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    height: auto !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    background: var(--woodmart-accent-color, #764a20) !important;
    color: #fff !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.vvs-results-notice__new svg {
    width: 16px;
    height: 16px;
}

/* ── Message ──────────────────────────────────────────────────────────── */
.vvs-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.vvs-message[hidden] {
    display: none;
}

.vvs-message--error {
    background: #fef0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.vvs-message--info {
    background: #f0f7ff;
    color: #2c5f8a;
    border: 1px solid #bee3f8;
}

/* ── Members only ─────────────────────────────────────────────────────── */
#vvs-members-only[hidden] {
    display: none;
}

.vvs-members-only {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    text-align: center;
}

.vvs-members-only__icon {
    color: #bbb;
}

.vvs-members-only__icon svg {
    width: 56px;
    height: 56px;
}

.vvs-members-only__text {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
}

.vvs-members-only__btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--woodmart-accent-color, #764a20);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: opacity 0.2s, transform 0.15s;
}

.vvs-members-only__btn:hover {
    opacity: 0.88;
    transform: scale(1.03);
    color: #fff !important;
}