/*
 * ╔══════════════════════════════════════════════════════════════╗
 * ║           SEARCH PREMIUM — Azure & Alabaster Theme           ║
 * ║                                                              ║
 * ║  Ely's Cure arama modal'ı için premium tasarım sistemi.     ║
 * ║  TailwindCSS KULLANMAZ — tamamen vanilla CSS.                ║
 * ║                                                              ║
 * ║  Brand Tokens:                                                ║
 * ║    Primary:  #2f5977 / #2C6480                               ║
 * ║    Accent:   #c9a96e                                         ║
 * ║    Surface:  #f8f9ff                                         ║
 * ║    Radius:   16px                                            ║
 * ╚══════════════════════════════════════════════════════════════╝
 */

/* ── Variables ── */
:root {
    --sp-primary: #2f5977;
    --sp-primary-deep: #094c67;
    --sp-primary-container: #2c6480;
    --sp-accent: #c9a96e;
    --sp-accent-hover: #b0915a;
    --sp-surface: #f8f9ff;
    --sp-surface-low: #eff4ff;
    --sp-surface-container: #e6eeff;
    --sp-on-surface: #121c2a;
    --sp-on-surface-variant: #41484d;
    --sp-outline: #71787d;
    --sp-white: #ffffff;
    --sp-radius-sm: 8px;
    --sp-radius-md: 12px;
    --sp-radius-lg: 16px;
    --sp-radius-xl: 20px;
    --sp-radius-full: 9999px;
    --sp-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sp-transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --sp-shadow-card: 0px 4px 20px rgba(0, 0, 0, 0.04), 0px 1px 3px rgba(0, 0, 0, 0.02);
    --sp-shadow-hover: 0px 10px 25px -5px rgba(0, 0, 0, 0.06);
}

/* ════════════════════════════════════════════════════
   OFFCANVAS OVERRIDE — Full-screen with scroll trap
   ════════════════════════════════════════════════════ */
#searchModal {
    background-color: rgba(44, 100, 128, 0.92) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
}

#searchModal .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

#searchModal .offcanvas-body {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    /* Fade mask — üst ve alt kenarlar soluklaşır */
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 92%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3%,
        black 92%,
        transparent 100%
    );
}

/* Body scroll lock — offcanvas açıkken (sadece body scroll engellenir) */
body.search-modal-open {
    overflow: hidden !important;
}

/* GSAP ScrollTrigger override — offcanvas içinde passthrough engelle */
#searchModal *,
#searchModal .offcanvas-body * {
    overscroll-behavior: contain;
}

/* ════════════════════════════════════════════════════
   PREMIUM SEARCH INPUT
   ════════════════════════════════════════════════════ */
.search-input-wrapper {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.search-input-wrapper input {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: var(--sp-radius-full);
    padding: 16px 56px 16px 52px;
    font-size: 16px;
    color: #fff;
    transition: all var(--sp-transition);
    width: 100%;
    letter-spacing: -0.01em;
    backdrop-filter: blur(10px);
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.50);
    font-weight: 400;
}

.search-input-wrapper input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.40);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10);
}

.search-input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.50);
    font-size: 18px;
    pointer-events: none;
    transition: color var(--sp-transition);
}

.search-input-wrapper input:focus ~ .search-input-icon {
    color: rgba(255, 255, 255, 0.80);
}

.search-clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.10);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.60);
    cursor: pointer;
    transition: all var(--sp-transition-fast);
    font-size: 12px;
    padding: 0;
}

.search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    color: #fff;
}

.search-clear-btn.visible {
    display: flex;
}

/* ════════════════════════════════════════════════════
   BENTO LAYOUT — Two Column Grid
   ════════════════════════════════════════════════════ */
.search-bento-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

@media (min-width: 1024px) {
    .search-bento-layout {
        grid-template-columns: 7fr 4fr;
        gap: 40px;
    }
}

/* Discovery verisi yoksa → tek sütun, sonuçlar %100 */
.search-bento-layout.no-discovery {
    grid-template-columns: 1fr !important;
}

.search-bento-layout.no-discovery .search-results-column {
    max-height: 70vh;
}

/* Left Column: Results — scrollable with fade mask */
.search-results-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    /* Smooth scroll fade mask */
    mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 88%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 0%,
        black 88%,
        transparent 100%
    );
}

/* Custom scrollbar for results */
.search-results-column::-webkit-scrollbar {
    width: 4px;
}

.search-results-column::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.search-results-column::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Right Column: Discovery */
.search-discovery-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ════════════════════════════════════════════════════
   SONUÇ SAYISI
   ════════════════════════════════════════════════════ */
.search-result-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.50);
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0 4px;
    margin-bottom: 8px;
}

/* ════════════════════════════════════════════════════
   ÜRÜN KARTLARI — Bento Result Items
   ════════════════════════════════════════════════════ */
.search-product-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 18px;
    border-radius: var(--sp-radius-md);
    text-decoration: none !important;
    color: inherit;
    transition: all var(--sp-transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 8px;
}

.search-product-card:hover,
.search-product-card:focus,
.search-product-card:active {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
    box-shadow: var(--sp-shadow-hover);
    text-decoration: none !important;
    color: inherit;
}

.search-product-card-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}

.search-product-img {
    width: 72px;
    height: 72px;
    border-radius: var(--sp-radius-sm);
    object-fit: contain;
    flex-shrink: 0;
    background: var(--sp-surface);
    padding: 6px;
    transition: transform var(--sp-transition);
}

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

.search-product-info {
    flex: 1;
    min-width: 0;
}

.search-product-title {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    text-decoration: none !important;
    transition: color var(--sp-transition-fast);
}

.search-product-card:hover .search-product-title {
    color: rgba(195, 231, 255, 0.95);
}

.search-product-category {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.50);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.search-product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-product-price {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

/* İndirimli fiyat — yeşil vurgu */
.search-product-price--sale {
    color: #6ee7a0;
    font-weight: 700;
}

/* Üstü çizili eski fiyat */
.search-product-compare-price {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.40);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.30);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.search-product-arrow {
    color: rgba(255, 255, 255, 0.25);
    font-size: 16px;
    transition: all var(--sp-transition-fast);
    flex-shrink: 0;
}

.search-product-card:hover .search-product-arrow {
    color: rgba(255, 255, 255, 0.70);
    transform: translateX(3px);
}

/* ════════════════════════════════════════════════════
   DISCOVERY PANEL — Featured Product Card
   ════════════════════════════════════════════════════ */
.search-discovery-featured {
    background: var(--sp-surface);
    border-radius: var(--sp-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sp-shadow-card);
    transition: transform var(--sp-transition), box-shadow var(--sp-transition);
}

.search-discovery-featured:hover {
    transform: translateY(-3px);
    box-shadow: var(--sp-shadow-hover);
}

/* Decorative gradient blob */
.search-discovery-featured::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: var(--sp-primary-container);
    opacity: 0.08;
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
}

.search-discovery-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sp-primary);
    margin-bottom: 16px;
}

.search-discovery-label i {
    font-size: 13px;
}

.search-discovery-img-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--sp-surface-low);
    border-radius: var(--sp-radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.search-discovery-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sp-white);
    color: var(--sp-primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 2;
}

.search-discovery-img {
    width: 75%;
    height: 75%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-discovery-featured:hover .search-discovery-img {
    transform: scale(1.06);
}

.search-discovery-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--sp-on-surface);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.search-discovery-desc {
    font-size: 14px;
    color: var(--sp-on-surface-variant);
    margin: 0 0 16px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-discovery-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--sp-primary);
    color: var(--sp-white);
    border: none;
    border-radius: var(--sp-radius-sm);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none !important;
    transition: background var(--sp-transition-fast);
}

.search-discovery-cta:hover {
    background: var(--sp-primary-deep);
    color: var(--sp-white);
    text-decoration: none !important;
}

.search-discovery-cta i {
    font-size: 14px;
}

/* ════════════════════════════════════════════════════
   DISCOVERY — Campaign Banner
   ════════════════════════════════════════════════════ */
.search-discovery-campaign {
    background: var(--sp-primary);
    color: #fff;
    border-radius: var(--sp-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sp-shadow-card);
    cursor: pointer;
    transition: transform var(--sp-transition);
}

.search-discovery-campaign:hover {
    transform: translateY(-2px);
}

.search-discovery-campaign::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
}

.search-campaign-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(4px);
    border-radius: var(--sp-radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-bottom: 12px;
}

.search-campaign-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.search-campaign-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.80);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.search-campaign-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none !important;
    transition: gap var(--sp-transition-fast);
}

.search-campaign-link:hover {
    gap: 8px;
    color: #fff;
    text-decoration: none !important;
}

.search-campaign-link i {
    font-size: 14px;
}

/* ════════════════════════════════════════════════════
   DISCOVERY — Suggested Categories
   ════════════════════════════════════════════════════ */
.search-discovery-cats-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.50);
    margin-bottom: 12px;
    padding-left: 2px;
}

.search-discovery-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ════════════════════════════════════════════════════
   POPULAR TAGS
   ════════════════════════════════════════════════════ */
.search-popular-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--sp-radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.70);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--sp-transition-fast);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.search-popular-tag:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.20);
    color: #fff;
    text-decoration: none !important;
}

/* ════════════════════════════════════════════════════
   STATUS MESSAGES
   ════════════════════════════════════════════════════ */
.search-status {
    text-align: center;
    padding: 40px 16px;
    color: rgba(255, 255, 255, 0.50);
    font-size: 14px;
}

.search-status-icon {
    font-size: 36px;
    margin-bottom: 14px;
    display: block;
    opacity: 0.35;
}

/* ════════════════════════════════════════════════════
   SKELETON LOADING
   ════════════════════════════════════════════════════ */
.search-skeleton {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: var(--sp-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.search-skeleton-img {
    width: 72px;
    height: 72px;
    border-radius: var(--sp-radius-sm);
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.10) 50%, rgba(255, 255, 255, 0.04) 60%);
    background-size: 200% 100%;
    animation: sp-skeleton-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

.search-skeleton-text {
    flex: 1;
}

.search-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.04) 40%, rgba(255, 255, 255, 0.10) 50%, rgba(255, 255, 255, 0.04) 60%);
    background-size: 200% 100%;
    animation: sp-skeleton-pulse 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}

.search-skeleton-line:last-child {
    width: 55%;
    margin-bottom: 0;
}

@keyframes sp-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════
   FADE-IN ANIMATION
   ════════════════════════════════════════════════════ */
@keyframes sp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ════════════════════════════════════════════════════ */

/* ≤ 767px — Mobile */
@media (max-width: 767px) {
    .search-input-wrapper input {
        font-size: 15px;
        padding: 14px 50px 14px 46px;
    }

    .search-product-img {
        width: 56px;
        height: 56px;
    }

    .search-product-card {
        padding: 12px 14px;
        gap: 14px;
    }

    .search-product-title {
        font-size: 14px;
    }

    .search-product-price {
        font-size: 14px;
    }

    .search-product-category {
        font-size: 10px;
    }

    .search-discovery-featured {
        padding: 20px;
    }

    .search-discovery-campaign {
        padding: 20px;
    }

    .search-campaign-title {
        font-size: 20px;
    }

    /* Mobile: Discovery panel under results */
    .search-bento-layout {
        gap: 24px;
    }
}

/* ≤ 374px — Small mobile */
@media (max-width: 374px) {
    .search-product-img {
        width: 48px;
        height: 48px;
    }

    .search-product-card {
        padding: 10px 12px;
        gap: 10px;
    }
}

/* ≥ 768px & ≤ 1023px — Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .search-bento-layout {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}
