/* ============================================================
   PRODUCT CATALOG PAGE (product.php) — Modern / Clean / Corporate
   Memakai variabel --hs-* yang sama dengan style.css (navy + amber,
   font Plus Jakarta Sans + Inter) supaya konsisten dengan halaman lain.
   ============================================================ */

/* ---------- HERO ---------- */
/* NOTE: background-image untuk .products-hero bersifat dinamis (dari
   $heroImage di PHP), jadi tetap di-set lewat inline <style> kecil
   di product.php. File ini menangani sisa property statisnya. */
.products-hero{
    position: relative;
    background:
        linear-gradient(180deg, rgba(22,39,62,0.12) 0%, rgba(22,39,62,0.4) 100%),
        var(--hs-hero-bg-fallback, none);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    padding: 150px 0 85px !important;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}
.products-hero .container{ position: relative; z-index: 2; }
.products-hero .hero-eyebrow{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--hs-font-mono, 'IBM Plex Mono', monospace);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hs-accent-safety, #E0912E);
    background: rgba(224, 145, 46, 0.12);
    border: 1px solid rgba(224, 145, 46, 0.3);
    padding: 6px 15px;
    border-radius: 999px;
    margin-bottom: 18px;
}
.products-hero h1{
    font-family: var(--hs-font-display, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    word-break: break-word;
    text-shadow: 0 2px 16px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.5);
}
.products-hero p{
    font-size: 1rem;
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

@media (max-width: 767px){
    .products-hero{ padding: 118px 0 60px !important; }
    .products-hero h1{ font-size: clamp(1.3rem, 6vw, 1.7rem); }
    .products-hero p{ font-size: 0.88rem; padding: 0 8px; }
}

/* ---------- SEARCH ---------- */
.search-container{ margin-bottom: 1.75rem; }
.search-wrapper{
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 60px;
    border: 1.5px solid #e5e9f0;
    box-shadow: 0 10px 25px -14px rgba(22,39,62,0.18);
    transition: all 0.25s ease;
}
.search-wrapper:focus-within{
    border-color: var(--hs-navy, #16273E);
    box-shadow: 0 0 0 4px rgba(22,39,62,0.08);
}
.search-icon{ padding: 0 0 0 20px; color: #94a3b8; }
.search-input{
    flex: 1;
    border: none;
    padding: 13px 10px;
    font-size: 0.92rem;
    background: transparent;
    outline: none;
    font-family: var(--hs-font-body, 'Inter', sans-serif);
}
.search-clear{
    background: none;
    border: none;
    color: #94a3b8;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}
.search-clear:hover{ color: #ef4444; background: #f1f5f9; }
.search-btn{
    background: var(--hs-navy, #16273E);
    border: none;
    padding: 11px 26px;
    border-radius: 60px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.search-btn:hover{ background: #0f1c2e; transform: translateY(-1px); }
.search-info{
    background: #f4f6f8;
    border: 1px solid #e5e9f0;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4A6280;
}
.search-info .badge{ background: var(--hs-accent-safety, #E0912E) !important; }

/* ---------- SIDEBAR KATEGORI ---------- */
.category-sidebar{
    background: #ffffff;
    border: 1px solid #e5e9f0;
    border-radius: 18px;
    padding: 24px 18px;
    box-shadow: 0 14px 34px -22px rgba(22,39,62,0.2);
    position: sticky;
    top: 100px;
}
.category-sidebar h4{
    font-family: var(--hs-font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--hs-navy, #16273E);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}
.category-sidebar h4 i{ color: var(--hs-accent-safety, #E0912E); }
.category-list{ list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.category-list a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #4A6280;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}
.category-list a i{ width: 18px; text-align: center; color: #94a3b8; transition: color 0.2s ease; }
.category-list a:hover{ background: #f4f6f8; color: var(--hs-navy, #16273E); }
.category-list a.active{
    background: var(--hs-navy, #16273E);
    color: #ffffff;
    box-shadow: 0 8px 18px -8px rgba(22,39,62,0.45);
}
.category-list a.active i{ color: var(--hs-accent-safety, #E0912E); }

@media (max-width: 991px){
    .category-sidebar{ position: static; margin-bottom: 1.5rem; }
}

/* ---------- SECTION HEADER ---------- */
.section-header h2{
    font-family: var(--hs-font-display, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    color: var(--hs-navy, #16273E);
    font-size: 1.55rem;
    margin-bottom: 6px;
}
.section-header p{ color: #647084; font-size: 0.95rem; }

/* ---------- PRODUCT CARD ---------- */
.product-card{
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #eef1f5;
    box-shadow: 0 12px 32px -20px rgba(22,39,62,0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 22px 42px -18px rgba(22,39,62,0.28);
}

.product-image{
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 250px;
    max-height: 320px;
    overflow: hidden;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.product-image img{
    width: 100%;
    height: 100%;
    object-fit: contain; /* gambar utuh, tidak terpotong */
    object-position: center center;
    display: block;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.product-card:hover .product-image img{ transform: scale(1.08); }
.product-image::after{
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(22,39,62,0) 55%, rgba(22,39,62,0.35) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.product-card:hover .product-image::after{ opacity: 1; }

/* Icon kaca pembesar di tengah gambar saat hover.
   pointer-events:none supaya klik tetap "tembus" ke div .product-image
   (yang sudah punya event listener klik) — jadi icon ini murni
   dekoratif/petunjuk visual, bukan trigger klik sendiri. */
.product-image .zoom-icon{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.95);
    color: var(--hs-navy, #16273E);
    border-radius: 50%;
    font-size: 1rem;
    box-shadow: 0 8px 20px -6px rgba(0,0,0,0.4);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.product-card:hover .product-image .zoom-icon{
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Body: flex column — hanya judul yang mengalir normal di atas,
   tombol otomatis "nempel" ke bawah lewat margin-top:auto. Karena
   .product-card sudah height:100% (disamakan tinggi baris oleh
   Bootstrap grid), posisi tombol otomatis sejajar di semua card
   dalam satu baris — tanpa perlu hack min-height atau absolute. */
.product-body{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 22px 20px 24px;
}

.product-title{
    font-family: var(--hs-font-display, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 1rem;
    color: var(--hs-navy, #16273E);
    line-height: 1.4;
    margin-bottom: 6px;
    /* Dibatasi 2 baris supaya judul sangat panjang tidak merusak layout,
       tapi TIDAK dipaksa min-height 2 baris — judul pendek tidak lagi
       menyisakan jarak kosong ganjil. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Tombol "Detail Produk" — bagian dari flow normal, didorong ke bawah
   lewat margin-top:auto. Selalu di posisi identik antar card (karena
   tinggi card disamakan oleh grid), tidak pernah melayang di tengah
   atau naik-turun mengikuti panjang teks.
   Skema warna: hitam solid standby → orange saat card di-hover. */
.btn-detail{
    margin-top: auto;
    padding-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1d21;
    color: #ffffff;
    border: 1.5px solid #1a1d21;
    padding-left: 22px;
    padding-right: 22px;
    padding-bottom: 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 10px 22px -10px rgba(0,0,0,0.45);
    transition: background 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease,
                transform 0.25s ease;
}
.btn-detail i{ font-size: 0.75rem; transition: transform 0.25s ease; }
.btn-detail:hover{ color: #ffffff; }
.product-card:hover .btn-detail{
    background: var(--hs-accent-safety, #E0912E);
    border-color: var(--hs-accent-safety, #E0912E);
    box-shadow: 0 12px 26px -10px rgba(224,145,46,0.55);
}
.product-card:hover .btn-detail i{ transform: translateX(3px); }

@media (prefers-reduced-motion: reduce){
    .product-card,
    .product-image img{ transition: none !important; }
}

@media (max-width: 991px){
    .product-image{
        min-height: 230px;
        max-height: 290px;
        padding: 10px;
    }
}

@media (max-width: 767px){
    .product-image{
        min-height: 210px;
        max-height: 260px;
        padding: 10px;
    }
}

/* ---------- HEADER TEKS & SEARCH DI MOBILE ---------- */
@media (max-width: 767px){
    .section-header{
        margin-bottom: 16px;
        text-align: left;
    }
    .section-header h2{
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    .section-header p{
        font-size: 0.82rem;
        line-height: 1.5;
    }

    .search-container{
        margin-bottom: 1.25rem;
    }
    .search-wrapper{
        border-radius: 14px;
    }
    .search-icon{
        padding-left: 14px;
        font-size: 0.85rem;
    }
    .search-input{
        font-size: 0.82rem;
        padding: 11px 8px;
    }
    .search-btn{
        padding: 9px 16px;
        font-size: 0.78rem;
        border-radius: 10px;
    }
}

/* ---------- GRID PRODUK: 2 KOLOM DI MOBILE ---------- */
@media (max-width: 767px){
    .product-grid{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 0;
        padding: 0;
        width: 100%;
        --bs-gutter-x: 0;
        --bs-gutter-y: 0;
    }
    .product-grid > [class*="col-"]{
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .product-grid .product-card{ border-radius: 14px; }

    .product-grid .product-image{
        min-height: 130px;
        max-height: 150px;
        padding: 8px;
    }
    .product-grid .product-image .zoom-icon{
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }

    .product-grid .product-body{
        padding: 12px 10px 14px;
        align-items: flex-start;
        text-align: left;
    }
    .product-grid .product-title{
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 10px;
    }
    .product-grid .btn-detail{
        width: 100%;
        justify-content: center;
        padding-left: 12px;
        padding-right: 12px;
        padding-top: 9px;
        padding-bottom: 9px;
        font-size: 0.72rem;
        gap: 6px;
        white-space: normal;
    }
}

@media (max-width: 380px){
    .product-grid{ gap: 10px; }
    .product-grid .product-image{ min-height: 110px; max-height: 130px; }
    .product-grid .product-title{ font-size: 0.75rem; }
}

/* ---------- MODAL ZOOM GAMBAR ---------- */
.image-modal{
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(10, 14, 20, 0.94);
    cursor: pointer;
}
.image-modal-content{
    position: relative;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 20px;
}
.image-modal-content img{
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

/* Tombol close — glassmorphism, ditempel di pojok kanan-atas gambar,
   dengan icon X garis tipis berujung rounded (SVG). PENTING: elemen
   <line> di SVG defaultnya stroke:none (invisible) kalau tidak diberi
   style — makanya butuh aturan .modal-close svg di bawah ini. Ini
   perbaikan untuk bug "icon cross kosong". */
.modal-close{
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 10000;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    box-shadow: 0 6px 18px -6px rgba(0,0,0,0.5);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.modal-close svg{
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.25s ease;
}
.modal-close:hover{
    background: var(--hs-navy, #16273E);
    border-color: var(--hs-navy, #16273E);
    transform: scale(1.08);
}
.modal-close:hover svg{ transform: rotate(90deg); }

@media (max-width: 767px){
    .modal-close{ top: 8px; right: 8px; width: 36px; height: 36px; }
    .modal-close svg{ width: 16px; height: 16px; }
}

/* Floating WhatsApp Button */
.floating-whatsapp{
    position: fixed;
    right: 20px;
    bottom: 95px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 30px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.22);
    z-index: 1200;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.floating-whatsapp:hover{
    color: #ffffff;
    background: #1ebe5b;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 34px rgba(0,0,0,0.28);
}
.floating-whatsapp:focus-visible{
    outline: 3px solid rgba(37,211,102,0.35);
    outline-offset: 3px;
}

@media (max-width: 767px){
    .floating-whatsapp{
        width: 54px;
        height: 54px;
        font-size: 27px;
        right: 14px;
        bottom: 88px;
    }
}