/* ==========================================================================
   ZIT Sales — Shop & Product Styles
   ========================================================================== */

/* ---------- Hero Banner ---------- */

.hero-banner {
    background: var(--zit-primary);
    color: #fff;
    padding: 80px 0;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-banner .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 24px;
    opacity: 0.9;
}

.hero-banner .btn-lg {
    padding: 14px 36px;
    font-size: 1.1rem;
}

/* ---------- Homepage Sections ---------- */

.homepage-section {
    padding: 48px 0;
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 24px;
    color: var(--zit-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-link {
    color: var(--zit-primary);
    text-decoration: none;
    font-weight: 600;
}

.section-link:hover {
    text-decoration: underline;
}

/* ---------- Category Grid ---------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.category-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.category-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.category-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #bbb;
}

.category-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.category-count {
    font-size: 0.8rem;
    color: #888;
}

/* ---------- Trust Badges ---------- */

.trust-badges {
    background: #f9f9f9;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.trust-item .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: var(--zit-primary);
    margin-bottom: 8px;
}

.trust-item h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.trust-item p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* ---------- Product Grid ---------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ---------- Product Card ---------- */

.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.product-card__image-link {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f5f5f5;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card__image {
    transform: scale(1.05);
}

.product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
}

.product-card__badge {
    position: absolute;
    top: 8px;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

.badge--sale {
    left: 8px;
    background: var(--zit-accent, #D32F2F);
    color: #fff;
}

.badge--out {
    right: 8px;
    left: auto;
    background: #666;
    color: #fff;
}

.product-card__info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card__category {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-card__title {
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-card__title a {
    color: inherit;
    text-decoration: none;
}

.product-card__title a:hover {
    color: var(--zit-primary);
}

.product-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--zit-primary);
    margin-bottom: 4px;
}

.product-card__price del {
    color: #999;
    font-weight: 400;
    font-size: 0.9rem;
    margin-right: 6px;
}

.product-card__price ins {
    text-decoration: none;
    color: var(--zit-accent, #D32F2F);
}

.product-card__wholesale {
    font-size: 0.78rem;
    color: #666;
    background: #f0f7f0;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 6px;
}

.product-card__stock {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stock-dot--in { background: var(--zit-success); }
.stock-dot--out { background: var(--zit-danger); }
.stock-dot--back { background: var(--zit-warning); }

.product-card .btn-sm {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

/* ---------- Shop Layout ---------- */

.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    padding: 30px 0;
}

.shop-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.sidebar-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--zit-primary);
}

.category-filter {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.category-filter li {
    margin-bottom: 2px;
}

.category-filter a {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.category-filter a:hover,
.category-filter li.active a {
    background: var(--zit-primary);
    color: #fff;
}

.category-filter .count {
    font-size: 0.8rem;
    opacity: 0.7;
}

.shop-header {
    margin-bottom: 24px;
}

.shop-header .page-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.result-count {
    font-size: 0.9rem;
    color: #666;
}

.shop-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-sort label {
    font-size: 0.9rem;
    color: #666;
}

.shop-sort select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
}

.no-products {
    text-align: center;
    padding: 60px 20px;
}

.no-products p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 16px;
}

/* ---------- Pagination ---------- */

.pagination {
    margin-top: 32px;
    text-align: center;
}

/* WooCommerce list type: nav.pagination > ul.page-numbers > li */
.pagination .page-numbers,
/* WordPress core: nav.navigation.pagination > div.nav-links */
.pagination .nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination .page-numbers li {
    display: contents;
}

.pagination .page-numbers a,
.pagination .page-numbers span,
.pagination .nav-links a,
.pagination .nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pagination .page-numbers span.current,
.pagination .nav-links span.current {
    background: var(--zit-primary);
    color: #fff;
    border-color: var(--zit-primary);
}

.pagination .page-numbers a:hover,
.pagination .nav-links a:hover {
    background: #f5f5f5;
}

/* ---------- Single Product ---------- */

.single-product-page {
    padding-top: 20px;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--zit-primary);
}

.breadcrumbs .sep {
    margin: 0 6px;
}

.breadcrumbs .current {
    color: #333;
    font-weight: 500;
}

.product-single {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

/* Gallery */

.product-gallery__main {
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1;
}

.product-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-gallery__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.product-gallery__placeholder .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: #ccc;
}

.product-gallery__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.product-gallery__thumb {
    width: 64px;
    height: 64px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: #f5f5f5;
}

.product-gallery__thumb.active {
    border-color: var(--zit-primary);
}

.product-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details */

.product-single__title {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.product-single__sku {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.product-single__categories {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 16px;
}

.product-single__categories a {
    color: var(--zit-primary);
    text-decoration: none;
}

.product-single__price-block {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price-regular {
    font-size: 1rem;
    color: #999;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--zit-primary);
}

.zit-tier-label {
    font-size: 0.85rem;
    color: #666;
    background: #f0f7f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.zit-tier-label:empty {
    display: none;
}

.zit-line-total-wrap {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #555;
}

.zit-line-total:empty {
    display: none;
}

/* Pricing Tiers Table */

.pricing-tiers-table {
    margin-bottom: 20px;
}

.pricing-tiers-table h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.pricing-tiers-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pricing-tiers-table th,
.pricing-tiers-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.pricing-tiers-table th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #555;
}

/* Add to Cart */

.add-to-cart-form {
    margin-bottom: 20px;
}

.stock-notice {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.stock-notice--out {
    background: #fde8e8;
    color: var(--zit-danger);
}

.stock-notice--low {
    background: #fff3e0;
    color: #e65100;
}

.zit-product-quantity {
    margin-bottom: 16px;
}

.zit-product-quantity label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e0e0e0;
}

.qty-control input[type="number"] {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.qty-control input[type="number"]::-webkit-inner-spin-button,
.qty-control input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-form .btn-lg {
    padding: 14px 36px;
    font-size: 1.1rem;
    width: 100%;
    max-width: 320px;
}

/* Product Description */

.product-single__excerpt {
    margin-top: 16px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.product-single__description {
    margin-bottom: 48px;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
}

.product-single__description h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.description-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
}

/* Related Products */

.related-products {
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
}

.related-products h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

/* ---------- Term Description ---------- */

.term-description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
    }

    .product-single {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-banner {
        padding: 50px 0;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card__info {
        padding: 8px;
    }

    .product-card__category {
        display: none;
    }

    .product-card__title {
        font-size: 0.82rem;
        margin-bottom: 4px;
    }

    .product-card__price {
        font-size: 0.95rem;
    }

    .product-card .btn-sm {
        font-size: 0.75rem !important;
        padding: 7px 8px !important;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .trust-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================================================
   Search Results Page
   ========================================================================== */

.search-results-page {
    padding: 36px 0 64px;
}

/* ── Header bar ──────────────────────────────────────── */

.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--zit-border);
    flex-wrap: wrap;
}

.search-header__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.search-header__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--zit-text);
    margin: 0;
}

.search-header__title span {
    color: var(--zit-primary);
}

.search-header__count {
    font-size: 0.85rem;
    color: var(--zit-text-light);
    margin: 0;
}

.search-header__form {
    flex-shrink: 0;
}

.search-header__input-wrap {
    display: flex;
}

.search-header__input {
    padding: 10px 16px;
    border: 1.5px solid var(--zit-border);
    border-right: none;
    border-radius: var(--zit-radius) 0 0 var(--zit-radius);
    font-size: 14px;
    width: 240px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
    background: #fafafa;
}

.search-header__input:focus {
    border-color: var(--zit-primary);
    background: #fff;
}

.search-header__btn {
    border-radius: 0 var(--zit-radius) var(--zit-radius) 0 !important;
    white-space: nowrap;
    padding: 10px 20px !important;
}

/* ── Results list ────────────────────────────────────── */

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

/* ── Horizontal product card ─────────────────────────── */

.search-result-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--zit-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.22s, border-color 0.22s;
}

.search-result-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    border-color: var(--zit-primary);
    text-decoration: none;
    color: inherit;
}

/* Image — fixed square, small */
.search-result-card__image {
    position: relative;
    display: block;
    width: 120px;
    min-width: 120px;
    background: #f4f4f4;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.search-result-card:hover .search-result-card__img {
    transform: scale(1.06);
}

.search-result-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    z-index: 1;
}

.search-result-card__badge.badge--sale {
    background: var(--zit-accent);
    color: #fff;
}

.search-result-card__badge.badge--out {
    background: #555;
    color: #fff;
}

/* Body — right side */
.search-result-card__body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    border-left: 1px solid var(--zit-border);
}

.search-result-card__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.search-result-card__cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--zit-primary);
    background: #f0f7f0;
    padding: 2px 9px;
    border-radius: 20px;
}

.search-result-card__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--zit-text);
    margin: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-card__name-link {
    color: inherit;
    text-decoration: none;
}

.search-result-card__name-link:hover {
    color: var(--zit-primary);
}

.search-result-card__desc {
    font-size: 0.82rem;
    color: var(--zit-text-light);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price + CTA row */
.search-result-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.search-result-card__price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--zit-primary);
    line-height: 1;
}

.search-result-card__price del {
    color: #aaa;
    font-weight: 400;
    font-size: 0.82rem;
    margin-right: 5px;
}

.search-result-card__price ins {
    text-decoration: none;
    color: var(--zit-accent);
}

.search-result-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.search-result-card__cta {
    white-space: nowrap;
    font-size: 0.8rem !important;
    padding: 6px 14px !important;
    text-decoration: none;
}

.search-result-card__cta--secondary {
    background: transparent;
    color: var(--zit-primary);
    border: 1px solid var(--zit-primary);
}

.search-result-card__cta--secondary:hover {
    background: var(--zit-primary);
    color: #fff;
}

/* ── No results ──────────────────────────────────────── */

.search-no-results {
    text-align: center;
    padding: 72px 20px;
}

.search-no-results__icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-no-results__msg {
    font-size: 1rem;
    color: var(--zit-text-light);
    margin-bottom: 24px;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-header__form,
    .search-header__input-wrap {
        width: 100%;
    }

    .search-header__input {
        width: 100%;
        flex: 1;
    }

    .search-result-card__image {
        width: 90px;
        min-width: 90px;
    }

    .search-result-card__body {
        padding: 12px 14px;
    }

    .search-result-card__name {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-result-card__image {
        width: 80px;
        min-width: 80px;
    }

    .search-result-card__desc {
        display: none;
    }

    .search-result-card__actions {
        width: 100%;
        margin-left: 0;
    }

    .search-result-card__cta {
        flex: 1;
        text-align: center;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
