/* ========================================
    SAKURA KONVEKSI - STYLE.CSS
    Versi: 2.5 (MOBILE PERFECT + BORDIR KOMPAK)
======================================== */

/* === VARIABEL WARNA === */
:root {
    --orange: #F36E21;
    --orange-hover: #e55a1a;
    --orange-light: #FFF5F0;
    --text-dark: #333333;
    --text-medium: #666666;
    --text-light: #999999;
    --border: #E5E5E5;
    --bg-white: #FFFFFF;
    --bg-page: #F8F9FA;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-pill: 50px;
    --transition: all 0.25s ease;
}

/* === RESET & TYPOGRAPHY === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 15px;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
.container { width: min(100% - 2rem, 1200px); margin: 0 auto; }

/* ========================================
    HEADER
======================================== */
.main-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}
.header-logo img { height: 40px; border-radius: 8px; }
.logo-text { font-weight: 700; font-size: 1.4rem; color: var(--orange); }
.search-form { flex: 1; max-width: 500px; position: relative; }
.search-form input {
    width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border);
    border-radius: var(--radius-pill); font-size: 0.95rem; outline: none;
}
.search-form input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(243, 110, 33, 0.15);
}
.search-form button {
    position: absolute; right: 6px; top: 6px; background: var(--orange);
    color: white; border: none; padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill); font-weight: 600; font-size: 0.85rem;
    cursor: pointer;
}
.search-form button:hover { background: var(--orange-hover); }

.category-tabs {
    display: flex; gap: 0.75rem; margin: 1.5rem 0 1rem;
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs a {
    background: var(--bg-white); color: var(--text-medium);
    padding: 0.6rem 1.1rem; border-radius: var(--radius-pill);
    font-size: 0.9rem; font-weight: 500; border: 1.5px solid var(--border);
    white-space: nowrap;
}
.category-tabs a:hover, .category-tabs a.active {
    background: var(--orange); color: white; border-color: var(--orange);
}

/* ========================================
    GRID PRODUK
======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem; margin-top: 1rem;
}
.product-card {
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}
.product-card:hover {
    transform: translateY(-6px); box-shadow: var(--shadow-md);
    border-color: var(--orange);
}
.img-container { aspect-ratio: 3 / 4; overflow: hidden; background: #f5f5f5; }
.img-container img { width: 100%; height: 100%; object-fit: cover; }
.product-card:hover img { transform: scale(1.06); }
.product-info { padding: 0.75rem; text-align: center; }
.product-info h3 {
    font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-info .price { font-size: 1.1rem; font-weight: 700; color: var(--orange); }

/* ========================================
    DETAIL PAGE - LAYOUT
======================================== */
.product-detail-layout {
    display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem;
}
@media (min-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1fr 1.3fr;
        grid-template-areas:
            "image header"
            "bordir ukuran"
            "warna catatan";
        gap: 1.5rem;
    }
}

/* Area Grid */
.product-main-image { grid-area: image; }
.product-info-header { grid-area: header; }
.content-box-detail:has(#order-color) { grid-area: warna; }
.content-box-detail:has(.size-grid) { grid-area: ukuran; }
.content-box-detail:has(#order-message) { grid-area: catatan; }
.content-box-detail.card-bordir-horizontal { grid-area: bordir; }

/* Gambar Utama */
.product-main-image {
    aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius-md);
    background: var(--bg-page); box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.product-main-image img { width: 100%; height: 100%; object-fit: cover; }

/* Header Produk */
.product-info-header {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.product-info-header .product-name {
    font-size: 1.4rem; font-weight: 700; line-height: 1.3; margin-bottom: 0.5rem;
}
.product-info-header .current-price {
    font-size: 1.8rem; font-weight: 800; color: var(--orange); line-height: 1;
}

/* Card Opsi */
.content-box-detail {
    background: var(--bg-white); border: 1.5px solid var(--border);
    border-radius: var(--radius-md); padding: 1rem; box-shadow: var(--shadow-sm);
}
.detail-section-title {
    font-size: 1.1rem; font-weight: 600; margin-bottom: 0.75rem;
}
.detail-section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;
}
.link-size-chart {
    font-size: 0.8rem; font-weight: 500; color: var(--orange);
}

/* ========================================
    BORDIR UI - KOMPAK & MOBILE PERFECT
======================================== */
.card-bordir-horizontal {
    padding: 0.75rem;
}
.bordir-scroll-container {
    overflow-x: auto; padding: 0.5rem 0;
    border-radius: var(--radius-md); background: var(--bg-page);
    border: 1px solid var(--border);
}
.bordir-scroll-container::-webkit-scrollbar { height: 5px; }
.bordir-scroll-container::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 3px; }
.bordir-scroll-container::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

#scroll-container {
    display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0;
    min-width: max-content;
}

/* Card Bordir */
.bordir-card {
    flex: 0 0 78px; text-align: center;
}
.bordir-card .box {
    width: 58px; height: 58px; margin: 0 auto 4px;
    border: 2px dashed #cbd5e1; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #94a3b8; cursor: pointer;
    transition: all 0.2s; position: relative; overflow: hidden;
    background: #f8fafc;
}
.bordir-card .box:hover { border-color: #f97316; color: #f97316; }
.bordir-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.bordir-card .remove-img {
    position: absolute; top: -5px; left: -5px; width: 18px; height: 18px;
    background: #ef4444; color: white; border-radius: 50%; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.bordir-card:hover .remove-img { opacity: 1; }
.bordir-card .loc {
    font-size: 8px; color: #475569; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 70px;
    line-height: 1.2; margin: 0 auto;
}

/* Tombol Tambah */
#add-custom-btn {
    flex: 0 0 78px; text-align: center;
}
#add-custom-btn .box {
    border: 2px dashed #fb923c; color: #fb923c; background: #fff7ed;
}
#add-custom-btn .box:hover { border-color: #f97316; color: #f97316; background: #fff4e6; }
#add-custom-btn span { font-size: 10px; color: #fb923c; font-weight: 500; }

/* Input Tersembunyi */
.hidden-file-input { width: 0.1px; height: 0.1px; opacity: 0; position: absolute; z-index: -1; }

/* ========================================
    UKURAN & INPUT
======================================== */
.size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.size-btn {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    background: var(--bg-white);
    font-weight: 600;
    font-size: 0.8rem;
    transition: var(--transition);
}
.size-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.size-btn span { display: block; font-size: 0.85rem; }
.size-btn small {
    font-size: 0.6rem; color: var(--orange); margin-top: 0.2rem;
    display: block; min-height: 0.8em;
}
.size-btn:hover { border-color: #aaa; }
.size-btn input:checked + *, .size-btn.checked {
    background: var(--orange); color: white; border-color: var(--orange);
}
.size-btn input:checked + * small { color: white; }

/* Input Warna & Catatan */
#order-color, #order-message {
    width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.9rem;
}
#order-color { height: 44px; }
#order-message { min-height: 80px; resize: vertical; }

/* Tombol Submit */
.btn-pesan {
    margin-top: 1rem; padding: 1rem; background: var(--orange);
    color: white; border: none; border-radius: var(--radius-sm);
    font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: var(--transition); width: 100%;
}
.btn-pesan:hover { background: var(--orange-hover); }

/* ========================================
    POPUP SIZE CHART
======================================== */
#size-chart-popup {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 1rem;
}
#size-chart-popup .bg-white {
    max-width: 90vw; max-height: 90vh; overflow: auto;
    border-radius: var(--radius-md); position: relative; padding: 1rem;
}
#close-size-chart {
    position: absolute; top: 0.5rem; right: 0.5rem;
    background: white; color: #666; width: 36px; height: 36px;
    border-radius: 50%; font-size: 1.5rem; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
}
#size-chart-image { width: 100%; border-radius: var(--radius-md); }

/* ========================================
    RESPONSIVE - MOBILE FIRST
======================================== */
@media (max-width: 480px) {
    .product-info-header .product-name { font-size: 1.2rem; }
    .product-info-header .current-price { font-size: 1.6rem; }
    .detail-section-title { font-size: 1rem; }
    .size-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
    .size-btn { padding: 0.4rem 0.2rem; font-size: 0.75rem; }
    .size-btn span { font-size: 0.8rem; }
    .bordir-card, #add-custom-btn { flex: 0 0 70px; }
    .bordir-card .box, #add-custom-btn .box { width: 52px; height: 52px; font-size: 22px; }
    .bordir-card .loc, #add-custom-btn span { font-size: 9px; max-width: 60px; }
}