/* =============================================
   Wyszukiwarka Artsens — Frontend
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800&family=Barlow:wght@400;500;600&display=swap');

.as-wrapper *,
.as-wrapper *::before,
.as-wrapper *::after,
.as-results *,
.as-results *::before,
.as-results *::after { box-sizing: border-box; }

/* ---------- Hero wrapper ---------- */
.as-wrapper {
    position: relative;
    background: var(--as-bg, #0d0d0d);
    padding: 60px 20px 70px;
    text-align: center;
    overflow: hidden;
}

.as-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 90% 55% at 50% 115%,
        color-mix(in srgb, var(--as-accent, #1e64d2) 20%, transparent) 0%,
        transparent 70%);
    pointer-events: none;
}

.as-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--as-accent, #1e64d2), transparent);
}

/* ---------- Inner ---------- */
.as-inner {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin: 0 auto;
}

/* ---------- Title & subtitle ---------- */
.as-title {
    font-family: 'Barlow Condensed', sans-serif !important;
    font-size: clamp(1.9rem, 5.5vw, 3rem) !important;
    font-weight: 800 !important;
    color: var(--as-title-color, #ffffff) !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    margin: 0 0 8px !important;
    line-height: 1.1 !important;
}

.as-subtitle {
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    color: var(--as-subtitle-color, #8ba3c2);
    letter-spacing: 0.07em;
    margin-bottom: 32px;
}

/* ---------- Form card ---------- */
.as-form {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

/* ---------- Row ---------- */
.as-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5eaf0;
    min-height: 58px;
    transition: background 0.15s;
}

.as-row:last-child { border-bottom: none; }
.as-row:focus-within { background: #f4f8ff; }

/* ---------- Number badge ---------- */
.as-num {
    width: 52px;
    flex-shrink: 0;
    padding-left: 20px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #b0bec8;
    letter-spacing: 0.04em;
}

/* ---------- Vertical divider ---------- */
.as-vline {
    width: 1px;
    height: 28px;
    background: #dde3ea;
    flex-shrink: 0;
    margin-right: 4px;
}

/* ---------- Select ---------- */
.as-select {
    flex: 1;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 10px;
    font-family: 'Barlow', sans-serif;
    font-size: 0.97rem;
    font-weight: 500;
    color: #1a2535;
    cursor: pointer;
    height: 58px;
}

.as-select:disabled {
    color: #aab4be;
    cursor: not-allowed;
}

/* ---------- Chevron ---------- */
.as-chevron {
    flex-shrink: 0;
    padding-right: 16px;
    color: #6b7d8f;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: transform 0.2s;
}

.as-row:focus-within .as-chevron { transform: rotate(180deg); }

/* ---------- Buttons ---------- */
.as-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.as-btn {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s, transform 0.1s, opacity 0.2s;
}

.as-btn:active { transform: scale(0.98); }

.as-btn--search {
    background: var(--as-accent, #1e64d2);
    color: #fff;
}

.as-btn--search:hover:not(:disabled) {
    filter: brightness(1.1);
}

.as-btn--search:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.as-btn--reset {
    background: rgba(255,255,255,0.08);
    color: #c8d5e8;
    border: 1px solid rgba(255,255,255,0.15);
}

.as-btn--reset:hover { background: rgba(255,255,255,0.14); }

/* ---------- Results ---------- */
.as-results {
    padding: 32px 20px 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.as-results__info {
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    color: #6b7d8f;
    margin-bottom: 20px;
    text-align: center;
}

/* ---------- Grid ---------- */
.as-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* ---------- Card ---------- */
.as-card {
    background: #fff;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.as-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}

.as-card__thumb {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: #f0f2f5;
}

.as-card__thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    aspect-ratio: 4/3;
}

.as-card__thumb--placeholder svg { opacity: 0.25; }

.as-card__body {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.as-card__title {
    font-family: 'Barlow', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a2535;
    line-height: 1.35;
}

.as-card__price {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1e64d2;
    margin-top: auto;
}

.as-card__excerpt {
    font-size: 0.8rem;
    color: #6b7d8f;
    line-height: 1.4;
    margin-top: auto;
}

.as-card__stock {
    font-size: 0.75rem;
    font-weight: 600;
}

.as-stock-yes { color: #2d9e5f; }
.as-stock-no  { color: #c0392b; }

/* ---------- Spinner ---------- */
.as-spinner {
    display: flex;
    justify-content: center;
    padding: 48px 0;
    grid-column: 1 / -1;
}

.as-spinner::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid #e0e7ef;
    border-top-color: #1e64d2;
    border-radius: 50%;
    animation: as-spin 0.7s linear infinite;
}

@keyframes as-spin { to { transform: rotate(360deg); } }

/* ---------- Empty ---------- */
.as-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 0;
    color: #8ba3c2;
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .as-wrapper { padding: 44px 16px 56px; }
    .as-results__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* Force card layout - override theme/WooCommerce styles */
.as-results__grid .as-card-item {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}
.as-results__grid .as-card-item img {
    width: 100% !important;
    display: block !important;
    flex-shrink: 0 !important;
}
.as-results__grid .as-card-item a {
    display: block !important;
    text-decoration: none !important;
}

/* DEV version base styles - override with custom CSS */
.as-results__grid .as-card-item {
    display: flex !important;
    flex-direction: column !important;
    background: #fff;
    overflow: hidden;
}
.as-results__grid .as-card-item .as-card-img {
    width: 100% !important;
    display: block !important;
    flex-shrink: 0;
}
.as-results__grid .as-card-item .as-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.as-results__grid .as-card-item .as-card-title {
    display: block;
    text-decoration: none;
    color: #1a2535;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 10px;
    flex-grow: 1;
}
.as-results__grid .as-card-item .as-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}
.as-results__grid .as-card-item .as-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #1e64d2;
}
.as-results__grid .as-card-item .as-card-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #1e64d2;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}
.as-results__grid .as-card-item .as-stock-yes { color: #2d9e5f; font-size: 12px; font-weight: 600; }
.as-results__grid .as-card-item .as-stock-no  { color: #c0392b; font-size: 12px; font-weight: 600; }

/* Card layout: stacked - image, title, price, button */
.as-results__grid .as-card-item {
    display: flex !important;
    flex-direction: column !important;
}
.as-results__grid .as-card-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1;
    padding: 10px 12px 14px;
}
.as-results__grid .as-card-title {
    display: block !important;
    text-align: center;
    margin-bottom: 8px;
    flex-grow: 1;
}
.as-results__grid .as-card-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    margin-top: 8px;
}
.as-results__grid .as-card-price {
    text-align: center;
    font-weight: 700;
}
.as-results__grid .as-card-btn-wrap {
    text-align: center;
}
.as-results__grid .as-card-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
