/* ================= CATEGORY HERO ================= */

.cat-hero {
    background: var(--orange);
    padding: 50px 16px;
    /* MOBILE FIX: Reduced padding and added horizontal padding */
    text-align: center;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    overflow-x: hidden;
    /* MOBILE FIX: Prevent horizontal overflow */
}

.cat-hero-inner .badge {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border: none;
    margin-bottom: 16px;
    display: inline-flex;
    /* MOBILE FIX: Ensure badge fits properly */
}

.cat-hero-inner h1 {
    font-size: clamp(1.5rem, 6vw, 3rem);
    /* RESPONSIVE FIX: Fluid sizing from 1.5rem mobile to 3rem desktop */
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--white);
    letter-spacing: -0.03em;
    line-height: 1.15;
    word-break: break-word;
    /* MOBILE FIX: Prevent overflow on long titles */
}

.cat-hero-inner .desc {
    max-width: 100%;
    /* MOBILE FIX: Changed from 620px to 100% */
    margin: 0 auto 40px;
    padding: 0 16px;
    /* MOBILE FIX: Added padding for small screens */
    font-size: clamp(0.95rem, 2.5vw, 1.02rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
}


/* ================= SEARCH ================= */

.cat-search-form {
    max-width: 100%;
    /* MOBILE FIX: Changed from 560px to 100% */
    margin: 0 auto;
    padding: 0 16px;
    /* MOBILE FIX: Added horizontal padding */
}

.cat-search-wrap {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 14px;
    padding: 6px 6px 6px 16px;
    /* MOBILE FIX: Reduced padding */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    gap: 8px;
    /* MOBILE FIX: Reduced gap */
    flex-wrap: nowrap;
    /* MOBILE FIX: Prevent wrapping */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

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

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

.cat-search-input::placeholder {
    color: #bbb;
}

.cat-search-btn {
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    /* MOBILE FIX: Reduced from 24px */
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
    min-height: 44px;
    /* MOBILE FIX: Ensure touch-friendly height */
}

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


/* ================= RESULT INFO ================= */

.cat-result-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    /* MOBILE FIX: Increased gap for wrap spacing */
    margin-bottom: 36px;
    padding: 14px 16px;
    /* MOBILE FIX: Reduced padding */
    background: #fff8f0;
    border: 1.5px solid rgba(214, 136, 42, 0.25);
    border-radius: 12px;
    font-size: clamp(0.85rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    color: var(--muted);
}

.cat-result-info strong {
    color: var(--ink);
}

.cat-result-info a {
    font-size: clamp(0.75rem, 2vw, 0.83rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-weight: 600;
    color: var(--orange);
    text-decoration: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    /* MOBILE FIX: Prevent wrapping */
}

.cat-result-info a:hover {
    opacity: 0.75;
}


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

.cat-products {
    background: var(--white);
    padding: 60px 16px;
    /* MOBILE FIX: Reduced padding and added horizontal padding */
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    overflow-x: hidden;
    /* MOBILE FIX: Prevent horizontal overflow */
}

.cat-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* MOBILE FIX: Single column on mobile by default */
    gap: 16px;
    /* MOBILE FIX: Reduced gap for mobile */
    max-width: 100%;
    /* MOBILE FIX: Explicit max-width */
}


/* Card */

.product-card {
    background: var(--white);
    border: 1.5px solid #ebebeb;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

.product-card:hover {
    border-color: rgba(214, 136, 42, 0.4);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.p-image {
    height: auto;
    /* MOBILE FIX: Changed from 210px to auto */
    aspect-ratio: 16 / 10;
    /* RESPONSIVE FIX: Maintains consistent aspect ratio */
    overflow: hidden;
    background: #f4f3f0;
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
}

.p-image img {
    width: 100%;
    /* MOBILE FIX: Explicit 100% width */
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

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

.p-content {
    padding: 16px;
    /* MOBILE FIX: Reduced from 22px 24px 24px */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.p-content h3 {
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ink);
    line-height: 1.35;
    word-break: break-word;
    /* MOBILE FIX: Prevent overflow */
}

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


/* Button */

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    /* MOBILE FIX: Increased to 44px+ height */
    border-radius: 10px;
    border: 1.5px solid var(--orange);
    color: var(--orange);
    font-size: clamp(0.8rem, 2vw, 0.85rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-weight: 600;
    text-decoration: none;
    transition: all 0.22s ease;
    align-self: flex-start;
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
    min-height: 44px;
    /* MOBILE FIX: Ensure touch target size */
}

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


/* ================= EMPTY STATE ================= */

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

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

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

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


/* ================= PAGINATION ================= */

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

.pg-btn {
    min-width: 40px;
    /* MOBILE FIX: Reduced from 44px */
    height: 40px;
    /* MOBILE FIX: Reduced from 44px */
    padding: 0 12px;
    /* MOBILE FIX: Reduced from 16px */
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid #e0e0e0;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    /* RESPONSIVE FIX: Fluid font sizing */
    font-family: var(--font);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
    /* MOBILE FIX: Prevent text wrapping */
}

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

.pg-active {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--white);
    cursor: default;
}

.pg-active:hover {
    color: var(--white);
}


/* ================= RESPONSIVE ================= */

@media (min-width: 481px) and (max-width: 768px) {
    .cat-hero {
        padding: 60px 20px;
    }
    .cat-hero-inner h1 {
        font-size: 2.2rem;
        margin-bottom: 16px;
    }
    .cat-hero-inner .desc {
        margin-bottom: 30px;
        font-size: 1rem;
    }
    .cat-search-form {
        padding: 0 20px;
    }
    .cat-search-btn {
        padding: 10px 20px;
    }
    .cat-products {
        padding: 70px 20px;
    }
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .p-content {
        padding: 18px;
    }
    .pg-btn {
        min-width: 42px;
        height: 42px;
        padding: 0 14px;
    }
}

@media (min-width: 769px) {
    .cat-hero {
        padding: 72px 0 80px;
    }
    .cat-hero-inner h1 {
        font-size: 3rem;
    }
    .cat-search-form {
        max-width: 560px;
    }
    .cat-search-wrap {
        gap: 10px;
        padding: 6px 6px 6px 18px;
    }
    .cat-search-btn {
        padding: 10px 24px;
    }
    .cat-products {
        padding: 80px 0 100px;
    }
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
    .p-image {
        height: 210px;
        aspect-ratio: auto;
    }
    .p-content {
        padding: 22px 24px 24px;
    }
    .pg-btn {
        min-width: 44px;
        height: 44px;
        padding: 0 16px;
    }
}

/* Showcase Media Box */
.cat-media-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: #000;
    aspect-ratio: 16 / 9;
    position: relative;
    z-index: 3;
}

.cat-media-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .cat-media-wrapper {
        margin-top: 30px;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }
}