/* Rajateknologi — stylesheet publik (diekstrak dari inline <style> di views supaya bisa di-cache browser) */

/* ---- views/components/header.php ---- */
:root { --rt-yellow: #ffcc00; --rt-grey-bg: #f5f5f5; --rt-border: #e0e0e0; }
        body { background-color: var(--rt-grey-bg); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; }
        .top-nav { background: white; border-bottom: 2px solid var(--rt-yellow); }
        .search-bar { border: 2px solid var(--rt-yellow); border-radius: 20px; font-size: 0.9rem; padding-right: 50px; }
        .btn-search { background-color: var(--rt-yellow); border: none; border-radius: 20px; padding: 5px 20px; margin-left: -45px; z-index: 10; transition: 0.3s; }
        .btn-search:hover { background-color: #e6b800; }
        .btn-warning, .bg-yellow { background-color: var(--rt-yellow) !important; border: none; font-weight: 600; color: #000 !important; }
        .btn-warning:hover { background-color: #e6b800; }
        .text-yellow { color: var(--rt-yellow); }
        .category-nav { background: #2c2c2c; padding: 8px 0; }
        .category-nav a { color: white; text-decoration: none; padding: 4px 12px; font-size: 0.85rem; font-weight: 500; }
        .category-nav a:hover { color: var(--rt-yellow); }

/* ---- views/components/header.php ---- */
.cart-badge {
    position: absolute; top: -6px; right: -10px;
    font-size: 0.65rem; padding: 3px 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ---- views/components/footer.php ---- */
.btn-floating-wa {
    position: fixed; bottom: 30px; right: 30px;
    background-color: #25D366; color: #ffffff;
    padding: 12px 24px; border-radius: 50px;
    font-size: 1rem; font-weight: bold;
    display: flex; align-items: center; gap: 10px;
    z-index: 9999; text-decoration: none;
    transition: all 0.3s ease;
}
.btn-floating-wa i { font-size: 1.5rem; }
.btn-floating-wa:hover {
    background-color: #1ebe57; color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(37, 211, 102, 0.4) !important;
}
@media (max-width: 768px) {
    .btn-floating-wa { padding: 15px; width: 60px; height: 60px; justify-content: center; }
    .btn-floating-wa span { display: none; }
    .btn-floating-wa i { font-size: 1.8rem; margin: 0; }
}

/* ---- views/components/pagination.php ---- */
.pagination-rt .page-link {
    color: #333;
    border: 1px solid #e0e0e0;
    margin: 0 3px;
    border-radius: 4px;
    min-width: 38px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.pagination-rt .page-item.active .page-link {
    background: #ffcc00;
    border-color: #ffcc00;
    color: #000;
}
.pagination-rt .page-link:hover {
    background: #fff8d6;
    color: #000;
    border-color: #ffcc00;
}
.pagination-rt .page-item.disabled .page-link {
    color: #bbb;
    background: #f8f9fa;
}

/* ---- views/components/product-card.php ---- */
.product-card { transition: transform 0.2s, box-shadow 0.2s; background: white; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important; }
.product-image-wrapper { aspect-ratio: 1/1; overflow: hidden; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
.product-image { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.product-name { line-height: 1.4; color: #555; min-height: 2.45em; }
.discount-badge { background: #dc3545; color: white; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.status-badge { font-size: 0.8rem; }

/* ---- views/components/sidebar-categories.php ---- */
.sidebar-categories .list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: #333;
    transition: background 0.15s;
}
.sidebar-categories .list-group-item:hover { background: #fffbe6; color: #000; }
.sidebar-categories .list-group-item.active-cat { background: #fff8d6; color: #000; border-left: 3px solid var(--rt-yellow, #ffcc00); }
.sidebar-categories .list-group-item:last-child { border-bottom: none; }
.sidebar-categories .sidebar-child { background: #fafafa; font-size: 0.82rem; padding-top: 7px; padding-bottom: 7px; }
.sidebar-categories .sidebar-child:hover { background: #fff8e6; }
.sidebar-categories .sidebar-cat-row { border-bottom: 1px solid #f0f0f0; }
.sidebar-categories .sidebar-cat-row:hover { background: #fffbe6; }
.sidebar-categories .sidebar-cat-row.active-cat { background: #fff8d6; border-left: 3px solid var(--rt-yellow, #ffcc00); }
.sidebar-categories .sidebar-toggle { width: 38px; color: #999; background: transparent; }
.sidebar-categories .sidebar-toggle:hover { color: #333; background: #fff3b3; }
.sidebar-categories .sidebar-toggle .toggle-icon { transition: transform 0.2s; transform: rotate(-90deg); font-size: 0.75rem; }
.sidebar-categories .sidebar-toggle[aria-expanded="true"] .toggle-icon { transform: rotate(0deg); }
.sidebar-categories .card-header { border-radius: 0; }

/* ---- views/pages/home.php ---- */
/* Slide banners */
.slide-banner {
    min-height: 320px;
    display: flex;
    align-items: center;
    padding: 2rem 3rem;
    color: #000;
    position: relative;
    overflow: hidden;
}
.slide-1 { background: linear-gradient(135deg, #ffcc00 0%, #ffd633 100%); }
.slide-2 { background: linear-gradient(135deg, #2c2c2c 0%, #4a4a4a 100%); color: #fff; }
.slide-2 .text-muted { color: #ddd !important; }
.slide-3 { background: linear-gradient(135deg, #1a4d1f 0%, #2d7a35 100%); color: #fff; }
.slide-4 { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); color: #fff; }
.slide-content { flex: 1; z-index: 2; max-width: 60%; }
.slide-icon { 
    position: absolute; 
    right: 3rem; 
    font-size: 8rem; 
    opacity: 0.25; 
    z-index: 1;
}
@media (max-width: 768px) {
    .slide-banner { min-height: 240px; padding: 1.5rem; }
    .slide-banner h2 { font-size: 1.25rem; }
    .slide-banner .lead { font-size: 0.95rem; }
    .slide-icon { font-size: 5rem; right: 1rem; }
}

/* Home product cards (small horizontal) */
.home-product-card { transition: transform 0.15s, box-shadow 0.15s; }
.home-product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1) !important; }
.home-image-wrapper { aspect-ratio: 1/1; background: #fafafa; overflow: hidden; border-bottom: 1px solid #f0f0f0; }
.home-product-img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.lainnya-card { background: #f8f9fa; min-height: 100%; }
.lainnya-card:hover { background: #fffbe6; }
.category-section h2, .category-section h3 { color: #333; letter-spacing: 0.5px; }

/* Home news card */
.home-news-card { transition: transform 0.15s, box-shadow 0.15s; }
.home-news-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1) !important; }

/* ---- views/pages/product.php ---- */
/* Gallery */
.product-gallery .main-image-wrapper { 
    aspect-ratio: 1/1; background: #fafafa; border: 1px solid #f0f0f0;
    border-radius: 8px; overflow: hidden; cursor: zoom-in;
    position: relative; transition: border-color 0.2s;
}
.product-gallery .main-image-wrapper:hover { border-color: #ffcc00; }
.product-gallery .main-image { 
    width: 100%; height: 100%; object-fit: contain; padding: 24px; transition: transform 0.3s;
}
.product-gallery .main-image-wrapper:hover .main-image { transform: scale(1.05); }
.zoom-hint {
    position: absolute; bottom: 12px; right: 12px;
    background: rgba(0,0,0,0.65); color: white;
    padding: 4px 10px; border-radius: 4px; font-size: 0.75rem;
    opacity: 0; transition: opacity 0.2s;
}
.main-image-wrapper:hover .zoom-hint { opacity: 1; }
.thumb-item {
    aspect-ratio: 1/1; background: #fafafa; border: 2px solid #f0f0f0;
    border-radius: 6px; overflow: hidden; cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}
.thumb-item img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.thumb-item:hover { border-color: #ffcc00; transform: translateY(-2px); }
.thumb-item.active { border-color: #ffcc00; box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.25); }

/* Info Table */
.info-table td { padding: 6px 4px; font-size: 0.875rem; vertical-align: top; }
.info-table tr { border-bottom: 1px solid #f0f0f0; }
.info-table tr:last-child { border-bottom: none; }

/* === ORDER BOX (kolom 3) — Style baru === */
.order-box {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
}

/* Stock indicator */
.stock-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.indicator-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.indicator-in { background: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15); }
.indicator-out { background: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15); }

/* Price utama (besar, hitam) */
.price-main { 
    font-size: 1.6rem; 
    font-weight: 700; 
    color: #000; 
    line-height: 1.2;
    word-break: break-word;
}
@media (max-width: 991px) { .price-main { font-size: 1.4rem; } }

/* Discount badge */
.discount-pct {
    display: inline-block;
    background: #ffcc00;
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
}
.old-price { 
    color: #999; 
    text-decoration: line-through; 
    font-size: 0.85rem;
}

/* Qty Selector */
.qty-selector {
    display: flex; align-items: center;
    border: 1px solid #ddd; border-radius: 6px;
    overflow: hidden; background: white;
    width: 100%;
    max-width: 140px;
}
.qty-btn {
    width: 38px; height: 38px;
    background: white; border: none;
    cursor: pointer;
    font-size: 1.1rem; color: #333; font-weight: 600;
    transition: background 0.15s;
}
.qty-btn:hover:not(:disabled) { background: #fff8d6; }
.qty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.qty-input {
    flex: 1; height: 38px;
    text-align: center;
    border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd;
    font-weight: 600; min-width: 0;
    -moz-appearance: textfield;
    background: white;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-add-cart { padding: 9px 12px; font-size: 0.95rem; }

/* Description */
.product-short-desc { line-height: 1.7; font-size: 0.95rem; color: #444; padding: 12px 16px; background: #fffbe6; border-left: 3px solid var(--rt-yellow, #ffcc00); border-radius: 4px; }
.product-description { line-height: 1.7; font-size: 0.95rem; color: #333; }
.product-description p { margin: 0 0 1rem; }
.product-description p:last-child { margin-bottom: 0; }
.product-description ul, .product-description ol { margin: 0 0 1rem; padding-left: 1.5rem; }
.product-description ul li, .product-description ol li { margin-bottom: 0.4rem; }
.product-description h1, .product-description h2, .product-description h3,
.product-description h4, .product-description h5, .product-description h6 {
    font-weight: 700; margin: 1.5rem 0 0.75rem; color: #1a1a2e;
}
.product-description h1 { font-size: 1.5rem; }
.product-description h2 { font-size: 1.3rem; }
.product-description h3 { font-size: 1.15rem; }
.product-description h4, .product-description h5, .product-description h6 { font-size: 1rem; }
.product-description strong, .product-description b { font-weight: 700; color: #1a1a2e; }
.product-description em, .product-description i { font-style: italic; }
.product-description a { color: #d6a800; text-decoration: underline; }
.product-description a:hover { color: #b58c00; }
.product-description img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.5rem 0; }
.product-description table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.product-description table th, .product-description table td {
    border: 1px solid #e5e5e5; padding: 8px 12px; text-align: left;
}
.product-description table th { background: #f8f9fa; font-weight: 600; }
.product-description blockquote {
    border-left: 3px solid var(--rt-yellow, #ffcc00);
    padding: 0.5rem 1rem; margin: 0 0 1rem; color: #555; background: #fffbe6;
}
.product-description hr { border: 0; border-top: 1px solid #e5e5e5; margin: 1.25rem 0; }
.product-description code { background: #f4f4f4; padding: 2px 6px; border-radius: 4px; font-size: 0.88rem; }
.product-description pre { background: #f4f4f4; padding: 12px; border-radius: 6px; overflow-x: auto; }
.product-description pre code { background: transparent; padding: 0; }

/* Tabs */
.nav-tabs .nav-link { color: #555; border: none; border-bottom: 3px solid transparent; padding: 10px 16px; }
.nav-tabs .nav-link.active { color: #000; background: transparent; border-bottom-color: #ffcc00; }
.nav-tabs .nav-link:hover { border-color: transparent; border-bottom-color: #ffe888; }

/* Modal */
.btn-close-modal {
    position: absolute; top: -50px; right: 0;
    background: rgba(255,255,255,0.2); border: none; color: white;
    width: 40px; height: 40px; border-radius: 50%; font-size: 1.25rem;
    cursor: pointer; transition: background 0.2s;
}
.btn-close-modal:hover { background: rgba(255,255,255,0.35); }
#modalImage { max-height: 80vh; object-fit: contain; }

/* === SLIDER PRODUK TERKAIT — 6 visible === */
.related-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 2px 12px;
    -webkit-overflow-scrolling: touch;
}
.related-slider::-webkit-scrollbar { height: 6px; }
.related-slider::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.related-slider::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.related-slider::-webkit-scrollbar-thumb:hover { background: #ffcc00; }

.slider-item {
    flex: 0 0 calc(16.6666% - 9px);  /* Desktop: 6 visible */
    scroll-snap-align: start;
    min-width: 0;
}
@media (max-width: 1199px) {
    .slider-item { flex: 0 0 calc(20% - 8px); }     /* 5 visible */
}
@media (max-width: 991px) {
    .slider-item { flex: 0 0 calc(33.333% - 7px); } /* Tablet: 3 */
}
@media (max-width: 575px) {
    .slider-item { flex: 0 0 calc(50% - 5px); }     /* Mobile: 2 */
}

/* Slider buttons */
.slider-btn {
    background: white; border: 1px solid #e0e0e0;
    width: 34px; height: 34px; border-radius: 50%;
    color: #333; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
}
.slider-btn:hover { background: #ffcc00; border-color: #ffcc00; color: #000; }
.slider-btn:active { transform: scale(0.95); }

/* Product card di dalam slider — kecil */
.slider-item .product-card { transition: transform 0.2s, box-shadow 0.2s; height: 100%; }
.slider-item .product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.12) !important; }
/* Card di slider lebih compact karena 6 item */
.slider-item .card-body { padding: 0.6rem 0.7rem !important; }
.slider-item .product-name { font-size: 0.75rem !important; min-height: 2em !important; }
.slider-item .status-badge { font-size: 0.7rem !important; }
.slider-item .price-wrapper .fs-5 { font-size: 0.95rem !important; }

/* ---- views/news/detail.php ---- */
.news-content { font-size: 1.05rem; line-height: 1.7; }
.news-content p { margin-bottom: 1rem; }
.news-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 1rem 0; }
.news-content h2, .news-content h3 { margin-top: 1.5rem; font-weight: 700; }
.news-content ul, .news-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ---- views/pages/static-page.php ---- */
.page-content { line-height: 1.7; }
.page-content h2, .page-content h3 { margin-top: 1.5rem; }
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
