/* ==========================================================
   Puppia_Search  —  pup-search- prefix
   Theme: Puppia/puppia_b2c  |  Version: 1.5.0
   Fonts: Inter (body) / Montserrat (headings) / Arial (logo)
   Rendered as raw HTTP response — no Magento layout wrapper.
   ========================================================== */

/* ── Google Fonts — match theme exactly ─────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

.pup-search-body {
    background: #fff;
    font-family: 'Inter', Arial, sans-serif;   /* matches @font-family__base */
    font-size: 14px;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Page wrapper ────────────────────────────────────────── */
.pup-search-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header: logo centered, X absolute top-right ─────────── */
.pup-search-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 64px;
    background: #fff;
    flex-shrink: 0;
}

/* Logo link */
.pup-search-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 0;
}

/* Logo image (when text logo is OFF) */
.pup-search-logo img {
    max-height: 52px;
    width: auto;
    display: block;
}

/* Text logo (when text logo is ON) — Arial, matches theme header */
.pup-search-logo-text {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #1a1a1a;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
}

/* X close — absolute right, no border, no circle */
.pup-search-close {
    position: absolute;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.pup-search-close:hover,
.pup-search-close:focus {
    opacity: 0.45;
    outline: none;
}

/* ── Main content ────────────────────────────────────────── */
.pup-search-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 64px;   /* 20px left/right for result area */
    gap: 36px;
    width: 100%;
}

/* ── Search form: 60% / min 400px / max 800px ────────────── */
.pup-search-form-wrap {
    width: 60%;
    min-width: 400px;
    max-width: 800px;
}

.pup-search-form { width: 100%; }

.pup-search-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    height: 62px;
    border: 2px solid #1a1a1a;
    border-radius: 50px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.pup-search-input-group:focus-within {
    box-shadow: 0 0 0 3px rgba(26,26,26,0.10);
}

/* Text input */
.pup-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 16px 0 26px;
    font-size: 1rem;
    font-family: 'Inter', Arial, sans-serif;
    background: transparent;
    color: #1a1a1a;
    height: 100%;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.pup-search-input::placeholder {
    color: #bbb;
    font-family: 'Inter', Arial, sans-serif;
}

.pup-search-input::-ms-clear { display: none; }
.pup-search-input[type=search]::-webkit-search-cancel-button,
.pup-search-input[type=search]::-webkit-search-decoration { display: none; }

/* Clear × */
.pup-search-clear {
    flex-shrink: 0;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
    transition: color 0.15s ease;
}
.pup-search-clear:hover { color: #1a1a1a; }

/* Submit — SVG icon, transparent, right side */
.pup-search-btn {
    flex-shrink: 0;
    height: 100%;
    padding: 0 22px;
    border: none;
    border-left: 1px solid #ddd;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.pup-search-btn:hover,
.pup-search-btn:focus {
    opacity: 0.55;
    outline: none;
}

/* ── CMS block ───────────────────────────────────────────── */
.pup-search-cms-content {
    width: 100%;
    max-width: calc(100% - 40px);  /* respects 20px L/R padding */
    text-align: center;
    font-family: 'Inter', Arial, sans-serif;
}

/* ── Results area — 20px padding L/R, full width ─────────── */
.pup-search-results-area {
    width: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pup-search-results-meta { text-align: left; }

.pup-search-results-count {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.875rem;
    color: #666;
}

.pup-search-no-results {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 1rem;
    color: #888;
    padding: 16px 0;
    text-align: center;
}

/* ── Product grid — 0 gap between cards ─────────────────── */
.pup-search-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(var(--pup-per-row, 6), 1fr);
    gap: 0;                        /* zero gap — cards touch each other */
}

/* ── Product card ────────────────────────────────────────── */
.pup-search-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8e8e8;
    /* Collapse double borders between cards */
    margin-right: -1px;
    margin-bottom: -1px;
    background: #fff;
    transition: z-index 0s, box-shadow 0.18s ease;
}

.pup-search-card:hover {
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* 1:1 image */
.pup-search-card__img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.pup-search-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.pup-search-card:hover .pup-search-card__img { opacity: 0.88; }

/* Name + price — Inter font */
.pup-search-card__info {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pup-search-card__name {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pup-search-card__price {
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1a1a1a;
}

/* ── View More ───────────────────────────────────────────── */
.pup-search-loadmore-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0 16px;
}

.pup-search-loadmore {
    padding: 13px 52px;
    border: 2px solid #1a1a1a !important;
    border-radius: 50px;
    background: #fff !important;
    color: #1a1a1a !important;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.pup-search-loadmore:hover,
.pup-search-loadmore:focus {
    background: #1a1a1a !important;
    color: #fff !important;
    outline: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1280px) {
    .pup-search-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 960px) {
    .pup-search-form-wrap { width: 80%; min-width: 0; }
    .pup-search-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .pup-search-header    { padding: 16px 52px 16px 16px; }
    .pup-search-close     { right: 16px; }
    .pup-search-main      { padding: 24px 0 48px; gap: 24px; }
    .pup-search-results-area { padding: 0 12px; }
    .pup-search-form-wrap { width: calc(100% - 24px); min-width: 0; max-width: none; }
    .pup-search-input-group { height: 52px; }
    .pup-search-grid      { grid-template-columns: repeat(2, 1fr); }
}
