@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --bg-glass: rgba(22, 27, 34, 0.85);
    --accent: #7c4dff;
    --accent-glow: rgba(124, 77, 255, 0.4);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ff4d4d;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Style Fix */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    touch-action: manipulation; /* Improved for mobile responsiveness */
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', 'Kanit', sans-serif; /* Priority to Inter for UI, Kanit for content */
    background-image: 
        radial-gradient(circle at 50% -20%, #1e1b4b 0%, var(--bg-main) 70%),
        radial-gradient(circle at 100% 100%, rgba(124, 77, 255, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: clamp(14px, 1vw + 10px, 16px); /* Fluid Typography 2026 */
}

/* Utility Classes 2026 */
.text-accent { color: var(--accent) !important; }
.text-accent-glow { color: var(--accent) !important; text-shadow: 0 0 15px var(--accent-glow); }

/* Price Styling Fix */
.price-tag-modern {
    color: var(--accent) !important;
    font-weight: 800;
}

.product-card .text-accent {
    color: var(--accent) !important;
    display: inline-block;
}

/* Row & Container Fix (Modern Flex/Grid Hybrid) */
.container {
    width: 100%;
    max-width: 1300px;
    padding-left: clamp(1rem, 5vw, 2rem);
    padding-right: clamp(1rem, 5vw, 2rem);
    margin-right: auto;
    margin-left: auto;
}

/* Product Grid Optimization */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 45vw, 280px), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    width: 100%;
}


/* Navbar */
.navbar {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 3000 !important;
}

.navbar-brand img {
    height: 55px;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.nav-link {
    color: var(--text-secondary) !important;
    transition: 0.3s;
}

.nav-link:hover { color: var(--text-primary) !important; }

/* Section Titles */
.section-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--accent) !important;
    text-shadow: 0 0 15px var(--accent-glow);
}

.section-title span { color: #fff; }

/* Cards */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px;
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent) !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
}

/* Advanced Product Card Upgrade */
.product-card {
    position: relative;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover {
    transform: translateY(-12px);
    border-color: var(--accent) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}

.product-card .card-img-container {
    position: relative;
    overflow: hidden;
    background: #000;
}

.product-card .card-img-container img {
    transition: transform 0.6s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card:hover .card-img-container img {
    transform: scale(1.1);
    opacity: 0.8;
}

.product-card .view-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #8b949e;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 500;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-card .card-body {
    padding: 1.25rem !important;
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 0.95rem !important;
    font-weight: 600;
    color: #f0f6fc !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .btn-buy-sm {
    background: var(--accent);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Breadcrumb Minimal Style */
.breadcrumb-minimal .breadcrumb-item {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.breadcrumb-minimal .breadcrumb-item a {
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    transition: var(--transition);
}

.breadcrumb-minimal .breadcrumb-item a:hover {
    color: var(--accent) !important;
}

.breadcrumb-minimal .breadcrumb-item.active {
    color: var(--text-primary) !important;
    opacity: 0.8;
}

.breadcrumb-minimal .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.2);
    content: "/";
    padding: 0 10px;
}

/* Dropdown Menu - Animation Fix */
.dropdown-menu {
    background: rgba(22, 27, 34, 0.98) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(124, 77, 255, 0.3) !important;
    border-radius: 15px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.9);
    padding: 8px !important;
    margin-top: 12px !important;
    z-index: 3001 !important;
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    pointer-events: none;
}

.dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    color: var(--text-secondary) !important;
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(124, 77, 255, 0.15) !important;
    color: #fff !important;
    padding-left: 22px !important;
}

/* Gallery */
.product-img-main { border-radius: 16px; background: #000; overflow: hidden; aspect-ratio: 1280 / 720; width: 100%; position: relative; }
.carousel-inner, .carousel-item { height: 100% !important; position: relative; cursor: default; overflow: hidden; }
.img-magnify { width: 100%; height: 100%; object-fit: contain; }
.thumb-container { display: flex; gap: 10px; margin-top: 15px; overflow-x: auto; padding-bottom: 5px; }
.thumb-item { width: 80px; height: 80px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; overflow: hidden; flex-shrink: 0; position: relative; transition: 0.3s; }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.thumb-item.active { border-color: var(--accent); }
.thumb-item.active img { opacity: 1; }
.thumb-video-indicator { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(124, 77, 255, 0.8); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Product Info */
.product-info-column { display: flex; flex-direction: column; height: 100%; justify-content: flex-start; }
@media (min-width: 992px) { .product-info-column { max-height: calc(100% + 15px); } }
.product-name-detail { font-size: 1.8rem; font-weight: 600; color: #ffffff; margin-bottom: 1rem; }
.payment-card-compact { background: rgba(255, 255, 255, 0.03) !important; backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.05) !important; border-radius: 20px !important; padding: 1.5rem !important; margin-top: auto; }
.badge-tag { background: rgba(124, 77, 255, 0.1) !important; color: var(--accent) !important; border: 1px solid rgba(124, 77, 255, 0.3) !important; border-radius: 50px !important; padding: 0.4rem 1rem !important; font-size: 0.75rem; margin-right: 5px; }

/* Product Description - Auto Height Fix (No Scrollbar) */
.product-description.ql-editor { 
    padding: 0 !important; 
    color: #ffffff !important; 
    line-height: 1.8; 
    height: auto !important; 
    min-height: unset !important;
    max-height: unset !important;
    overflow: visible !important; 
}

/* Heading Sizes in Description */
.product-description h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 1.5rem; color: #fff; }
.product-description h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.2rem; color: #fff; }
.product-description h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: #fff; }
.product-description h4 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.8rem; color: #fff; }
.product-description h5 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; color: #fff; }
.product-description h6 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: #fff; }
@media (max-width: 768px) {
    .product-description h1 { font-size: 1.8rem; }
    .product-description h2 { font-size: 1.5rem; }
    .product-description h3 { font-size: 1.3rem; }
    .product-description h4 { font-size: 1.1rem; }
}

/* Premium Code Block v2026 (Simplified) */
.product-description pre, pre.ql-syntax {
    background: #1a1d21 !important;
    border-radius: 12px !important;
    margin: 0.50rem 0 !important; /* Reduced external margin */
    padding: 1.5rem !important;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.product-description code, pre.ql-syntax {
    font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace !important;
    font-size: 0.9rem !important;
    background: transparent !important;
    padding: 0 !important;
    color: #e6edf3 !important;
    line-height: 1.4 !important; /* Reduced line-height for compact look */
}

.product-description pre code, pre.ql-syntax {
    display: block;
    overflow-x: auto;
    padding: 10px 5px !important; /* Added internal padding to prevent touching borders */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

/* Custom Scrollbar for Code Blocks */
.product-description pre code::-webkit-scrollbar, pre.ql-syntax::-webkit-scrollbar { height: 6px; }
.product-description pre code::-webkit-scrollbar-track, pre.ql-syntax::-webkit-scrollbar-track { background: transparent; }
.product-description pre code::-webkit-scrollbar-thumb, pre.ql-syntax::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 10px; }
.product-description img { 
    max-width: 100% !important; 
    height: auto !important; 
    display: block; 
    margin: 1.5rem 0;
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Premium Footer */
.footer-premium {
    background: linear-gradient(to top, #050608 0%, transparent 100%);
    padding: 40px 0;
    border-top: 1px solid rgba(124, 77, 255, 0.15);
    margin-top: 40px;
    position: relative;
}

.footer-premium::before {
    content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 180px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 10px var(--accent);
}

.footer-copyright { color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; opacity: 0.8; text-align: center; }
.footer-premium a { color: var(--accent); text-decoration: none; font-weight: 700; }

/* Responsive Navbar */
@media (max-width: 991px) {
    .navbar .container { display: flex; flex-direction: row-reverse; justify-content: space-between; position: relative; }
    .navbar-brand { position: absolute; left: 50%; transform: translateX(-50%); z-index: 1002; }
    .navbar-collapse { 
        background: rgba(10, 12, 16, 0.98); 
        backdrop-filter: blur(20px); 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100vh; 
        z-index: 999; 
        display: flex !important; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
        transition: all 0.3s ease-out; 
        transform: translateY(-100%); 
        opacity: 0; 
        visibility: hidden; 
    }
    .navbar-collapse.show { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-link { font-size: 1.2rem !important; font-weight: 500; color: #fff !important; text-transform: uppercase; }
}

/* SweetAlert2 Overrides */
.swal2-responsive-popup {
    width: 95% !important;
    max-width: 600px !important;
}

/* Affiliate Marketplace Buttons - Ultra Premium 2026 */
.btn-affiliate {
    width: 100% !important;
    padding: 16px 20px !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 12px !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 0.9rem !important;
    position: relative !important;
    overflow: hidden !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    z-index: 1 !important;
}

.btn-affiliate i {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important; /* Spacing between icon and text (1 space bar equivalent) */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)) !important;
    transition: transform 0.3s ease !important;
}

/* Hover States - Forced with !important for absolute precedence */
.btn-affiliate:hover {
    transform: translateY(-8px) scale(1.04) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #ffffff !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6) !important;
}

.btn-affiliate:hover i {
    transform: scale(1.3) rotate(-10deg) !important;
}

/* Shine Effect Animation */
.btn-affiliate::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -150% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    ) !important;
    transition: all 0.6s !important;
    z-index: -1 !important;
}

.btn-affiliate:hover::before {
    left: 150% !important;
}

/* Brand Specific Colors - Preserved and Gilded */
.btn-lazada {
    background: #00008b !important;
    background: linear-gradient(135deg, #00008b 0%, #0000ff 100%) !important;
}
.btn-lazada:hover { box-shadow: 0 12px 30px rgba(0, 0, 255, 0.5), 0 0 20px rgba(0, 0, 255, 0.3) !important; }

.btn-shopee {
    background: #ee4d2d !important;
    background: linear-gradient(135deg, #ee4d2d 0%, #ff7337 100%) !important;
}
.btn-shopee:hover { box-shadow: 0 12px 30px rgba(238, 77, 45, 0.5), 0 0 20px rgba(238, 77, 45, 0.3) !important; }

.btn-tiktok {
    background: #000000 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}
.btn-tiktok:hover { box-shadow: -5px 0 25px rgba(255, 0, 80, 0.6), 5px 0 25px rgba(0, 242, 234, 0.6) !important; }

.btn-line {
    background: #06c755 !important;
    background: linear-gradient(135deg, #06c755 0%, #05e662 100%) !important;
}
.btn-line:hover { box-shadow: 0 12px 30px rgba(6, 199, 85, 0.5), 0 0 20px rgba(6, 199, 85, 0.3) !important; }

.marketplace-title {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 2.5px !important;
    margin-bottom: 22px !important;
    display: block !important;
    text-align: center !important;
    opacity: 1 !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
}

/* Share Box 2026 Fix */
.share-box-bottom {
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
}

.btn-share-lg {
    padding: 10px 18px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center;
    gap: 10px;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    color: #fff !important;
}

.btn-share-lg.btn-facebook { background-color: #1877F2 !important; }
.btn-share-lg.btn-line { background-color: #06C755 !important; }
.btn-share-lg.btn-twitter { background-color: #000 !important; border: 1px solid rgba(255,255,255,0.3) !important; }
.btn-share-lg.btn-copy { background-color: var(--accent) !important; box-shadow: 0 0 15px var(--accent-glow) !important; }

/* Filter Card */
.filter-card {
    overflow: visible !important;
    position: relative;
    z-index: 1100 !important;
}

.filter-card form {
    position: relative;
    z-index: 1101;
}

.row.g-4 {
    position: relative;
    z-index: 1;
}
