/* ================= PRODUCTS HERO SECTION ================= */

.products-hero {
    background: var(--orange);
    padding: clamp(38px, 8vw, 60px) 0;
    /* MOBILE FIX: Reduced and added horizontal padding */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    overflow-x: hidden;
    /* MOBILE FIX: Prevent horizontal overflow */
}

.products-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* MOBILE FIX: Single column on mobile */
    align-items: center;
    /* margin-left: 0; */
    /* MOBILE FIX: Removed fixed margin */
    gap: clamp(26px, 6vw, 50px);
    /* MOBILE FIX: Added gap for spacing */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    min-width: 0;
}

.products-hero-content,
.products-hero-visual {
    min-width: 0;
}


/* LEFT CONTENT */

.products-hero-content h1 {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    /* RESPONSIVE FIX: Fluid sizing */
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
    margin: 0 0 clamp(18px, 4vw, 22px);
    overflow-wrap: anywhere;
    /* MOBILE FIX: Prevent overflow */
}

.products-hero-content .desc {
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    margin: 20px 0 34px;
    line-height: 1.65;
    max-width: 100%;
    /* MOBILE FIX: Changed from 520px */
}


/* RIGHT IMAGE */

.products-hero-visual {
    display: flex;
    justify-content: center;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    min-width: 0;
}

.products-frame {
    width: min(82vw, 420px);
    /* MOBILE FIX: Changed from 420px/440px */
    max-width: 420px;
    /* MOBILE FIX: Set max-width for desktop */
    height: auto;
    /* MOBILE FIX: Changed from 420px/440px */
    aspect-ratio: 1 / 1;
    /* RESPONSIVE FIX: Maintains square aspect ratio */
    border-radius: 160px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    margin: auto;
    /* MOBILE FIX: Center on mobile */
    flex: 0 1 auto;
}

.products-frame img {
    width: 100%;
    /* MOBILE FIX: Explicit 100% */
    height: 100%;
    object-fit: cover;
}


/* Hero Search Form */

.hero-search-form {
    max-width: 100%;
    /* MOBILE FIX: Changed from 500px */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    min-width: 0;
}

.search-wrap {
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 6px;
    /* MOBILE FIX: Reduced from 20px */
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    gap: 8px;
    /* MOBILE FIX: Reduced from 12px */
    flex-wrap: nowrap;
    /* MOBILE FIX: Prevent wrapping */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    max-width: 100%;
    min-width: 0;
}

.search-icon {
    color: #888;
    flex-shrink: 0;
    min-width: 18px;
    /* MOBILE FIX: Prevent shrinking */
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: clamp(0.9rem, 2vw, 1rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    padding: 8px 4px;
    /* MOBILE FIX: Adjusted padding */
    color: var(--ink);
    font-family: inherit;
    min-width: 0;
    /* MOBILE FIX: Prevent input from shrinking too much */
}

.search-btn {
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    /* MOBILE FIX: Reduced from 12px 25px */
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    min-height: 44px;
    /* MOBILE FIX: Ensure touch target */
    flex: 0 0 auto;
}

.search-btn:hover {
    background: #b46f1e;
}


/* ================= PRODUCT GRID ================= */

.product-categories {
    padding: 60px 16px;
    /* MOBILE FIX: Reduced from 100px 0 and added horizontal padding */
    background: #fafafa;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    overflow-x: hidden;
    /* MOBILE FIX: Prevent horizontal overflow */
}

.result-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* MOBILE FIX: Allow wrapping */
    gap: 12px;
    /* MOBILE FIX: Added gap */
    background: #fff;
    padding: 14px 16px;
    /* MOBILE FIX: Reduced from 15px 25px */
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 30px;
    /* MOBILE FIX: Reduced from 40px */
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    /* RESPONSIVE FIX: Fluid font sizing */
}

.result-info a {
    color: var(--orange);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    /* MOBILE FIX: Prevent wrapping */
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* MOBILE FIX: Single column on mobile */
    gap: 16px;
    /* MOBILE FIX: Reduced from 30px */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}


/* Category Card */

.category-card {
    background: var(--white);
    border-radius: 16px;
    /* MOBILE FIX: Reduced from 20px */
    border: 1px solid #eee;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--orange);
}

.category-image {
    height: auto;
    /* MOBILE FIX: Changed from 230px */
    aspect-ratio: 16 / 9;
    /* RESPONSIVE FIX: Maintains consistent aspect ratio */
    overflow: hidden;
    background: #f1f1f1;
    border-radius: 16px 16px 0 0;
    /* MOBILE FIX: Reduced from 20px 20px 0 0 */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

.category-image img {
    width: 100%;
    /* MOBILE FIX: Explicit 100% */
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.category-card:hover .category-image img {
    transform: scale(1.08);
}

.img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 6vw, 3rem);
    /* RESPONSIVE FIX: Fluid icon sizing */
}

.category-content {
    padding: 18px;
    /* MOBILE FIX: Reduced from 30px */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-content h3 {
    font-size: clamp(1rem, 3vw, 1.25rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-weight: 700;
    margin-bottom: 10px;
    /* MOBILE FIX: Reduced from 12px */
    color: var(--ink);
    word-break: break-word;
    /* MOBILE FIX: Prevent overflow */
}

.category-content p {
    color: var(--muted);
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    line-height: 1.6;
    margin-bottom: 16px;
    /* MOBILE FIX: Reduced from 25px */
    flex: 1;
}

.btn-outline {
    align-self: flex-start;
    padding: 12px 18px;
    /* MOBILE FIX: Increased to ensure 44px+ height */
    border: 1.5px solid var(--orange);
    color: var(--orange);
    border-radius: 10px;
    font-weight: 600;
    transition: 0.3s;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
    min-height: 44px;
    /* MOBILE FIX: Ensure touch target */
}

.btn-outline:hover {
    background: var(--orange);
    color: var(--white);
}


/* ================= PAGINATION & EMPTY ================= */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 6px;
    /* MOBILE FIX: Reduced from 8px */
    margin-top: 50px;
    /* MOBILE FIX: Reduced from 60px */
    flex-wrap: wrap;
    padding: 0 16px;
    /* MOBILE FIX: Added horizontal padding */
}

.page-btn {
    min-width: 40px;
    /* MOBILE FIX: Reduced from 45px */
    height: 40px;
    /* MOBILE FIX: Reduced from 45px */
    padding: 0 12px;
    /* MOBILE FIX: Responsive padding */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    transition: all 0.2s ease;
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
}

.page-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.page-btn.active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

.empty-state {
    text-align: center;
    padding: 50px 16px;
    /* MOBILE FIX: Reduced from 60px 0 and added horizontal padding */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

.empty-icon {
    font-size: clamp(2.5rem, 8vw, 4rem);
    /* RESPONSIVE FIX: Fluid icon sizing */
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    /* RESPONSIVE FIX: Fluid heading sizing */
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    color: var(--muted);
    margin-bottom: 20px;
}


/* Responsive */

@media (min-width: 481px) and (max-width: 768px) {
    .products-hero {
        padding: 56px 0;
    }
    .products-hero-grid {
        gap: 40px;
    }
    .products-hero-content h1 {
        font-size: clamp(2rem, 5.6vw, 2.35rem);
    }
    .products-frame {
        width: min(58vw, 350px);
    }
    .product-categories {
        padding: 70px 20px;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .category-image {
        aspect-ratio: 16 / 9;
    }
    .category-content {
        padding: 16px;
    }
    .page-btn {
        min-width: 42px;
        height: 42px;
    }
}

@media (min-width: 769px) {
    .products-hero {
        padding: 60px 0;
    }
    .products-hero-grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
        gap: clamp(40px, 5vw, 64px);
        text-align: left;
    }
    .products-hero-content h1 br {
        display: inline;
    }
    .products-frame {
        width: min(100%, 440px);
        max-width: 440px;
    }
    .hero-search-form {
        max-width: 500px;
        margin: 0;
    }
    .product-categories {
        padding: 80px 0;
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
    .category-image {
        height: 230px;
        aspect-ratio: auto;
    }
    .category-content {
        padding: 24px;
    }
    .category-content h3 {
        font-size: 1.25rem;
    }
    .category-content p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }
    .page-btn {
        min-width: 44px;
        height: 44px;
        gap: 8px;
    }
}

@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-hero {
        padding: 48px 0;
    }
    .products-hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        margin-left: 0;
    }
    .products-hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .products-hero-content h1 br {
        display: none;
    }
    .products-hero-content h1 {
        font-size: clamp(1.75rem, 7vw, 2.1rem);
        text-align: center;
    }
    .hero-search-form {
        margin: 0 auto;
        max-width: 560px;
    }
    .products-hero-visual {
        width: 100%;
    }
    .products-frame {
        max-width: 350px;
        width: 100%;
    }
    .product-categories {
        padding: 60px 16px;
    }
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .category-image {
        aspect-ratio: 16 / 9;
    }
    .category-content {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .products-hero-content h1 {
        font-size: clamp(1.55rem, 8.8vw, 1.9rem);
    }
    .result-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-btn {
        min-width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}


/* --- MOBILE FIX: keep categories hero search usable and overflow-free at 320px-480px. --- */

@media (max-width: 480px) {
    .products-hero {
        padding: 38px 0 42px;
    }
    .products-hero-grid {
        gap: 24px;
    }

    /* MOBILE FIX: place hero image above the search bar without changing HTML or functionality. */
    .products-hero-content {
        display: contents;
    }

    .products-hero-content .badge {
        order: 1;
        justify-self: center;
    }

    .products-hero-content h1 {
        order: 2;
        line-height: 1.18;
        margin-bottom: 18px;
    }

    .products-hero-visual {
        order: 3;
    }

    .products-frame {
        width: min(76vw, 280px);
        border-radius: 50px;
        ;
    }
    .hero-search-form {
        order: 4;
        max-width: 100%;
    }
    .search-wrap {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 8px;
        gap: 8px;
    }
    .search-icon {
        margin-top: 11px;
    }
    .search-input {
        flex: 1 1 calc(100% - 34px);
        min-height: 44px;
    }
    .search-btn {
        width: 100%;
        padding: 11px 16px;
    }
}


/* --- RESPONSIVE FIX: tiny screens get tighter hero media without changing content. --- */

@media (max-width: 360px) {
    .products-hero-content h1 {
        font-size: 1.45rem;
    }
    .products-frame {
        width: min(72vw, 240px);
    }
}
