/* ═══════════════════════════════════════════════════════════
   MerchPlatform v2.0 — Ultra Modern Merchandising Theme
   Design System: Dark Elegance + Vibrant Accents
   ═══════════════════════════════════════════════════════════ */

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --primary-light: #5dade2;
    --accent: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --dark: #1a1c23;
    --darker: #111318;
    --body-bg: #f8f9fb;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #e8eaf0;
    --shadow: 0 2px 20px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.1);
    --shadow-hover: 0 12px 48px rgba(0,0,0,.14);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all .3s cubic-bezier(.4,0,.2,1);
    --header-h: 72px;
    --nav-h: 50px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ═══ TOP BAR ═══ */
.topbar { font-size: 12px; color: rgba(255,255,255,.7); }
.topbar-text { font-weight: 500; }

/* ═══ HEADER ═══ */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.header-inner {
    display: flex; align-items: center; gap: 20px;
    height: var(--header-h); padding: 0;
}

.header-logo img { height: 44px; width: auto; transition: var(--transition); }
.header-logo:hover img { transform: scale(1.02); }
.logo-text { font-size: 22px; font-weight: 800; color: var(--dark); letter-spacing: -.5px; }

.header-search { flex: 1; max-width: 560px; position: relative; }

.search-wrapper {
    position: relative; display: flex; align-items: center;
    background: var(--body-bg); border: 2px solid transparent;
    border-radius: 50px; transition: var(--transition); overflow: hidden;
}
.search-wrapper:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(52,152,219,.1); }

.search-input {
    width: 100%; border: none; outline: none; background: transparent;
    padding: 10px 20px; font-family: var(--font); font-size: 14px;
    color: var(--text);
}
.search-input::placeholder { color: var(--text-light); }

.search-btn {
    border: none; background: var(--primary); color: #fff;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); flex-shrink: 0;
    border-radius: 0 50px 50px 0;
}
.search-btn:hover { background: var(--primary-dark); }

.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); display: none; z-index: 100;
    max-height: 400px; overflow-y: auto; margin-top: 4px;
}
.search-suggestions.active { display: block; }

.suggestion-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; cursor: pointer; transition: var(--transition);
}
.suggestion-item:hover { background: var(--body-bg); }
.suggestion-item img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); }

.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.cart-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary); color: #fff !important;
    padding: 10px 20px; border-radius: 50px;
    font-weight: 600; font-size: 13px;
    position: relative; transition: var(--transition);
}
.cart-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52,152,219,.3); color: #fff !important; }

.cart-count {
    background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px; line-height: 20px;
    text-align: center; border-radius: 50%;
    position: absolute; top: -4px; right: -4px;
}

.mobile-toggle {
    width: 36px; height: 36px; background: none; border: none;
    display: flex; flex-direction: column; justify-content: center;
    gap: 5px; cursor: pointer; padding: 4px;
}
.mobile-toggle span {
    display: block; height: 2px; background: var(--dark);
    border-radius: 2px; transition: var(--transition);
}

/* ═══ NAVIGATION ═══ */
.main-nav { position: sticky; top: var(--header-h); z-index: 999; }

.nav-inner { display: flex; align-items: center; height: var(--nav-h); }

.nav-categories-dropdown { position: relative; flex-shrink: 0; }

.nav-cat-trigger {
    display: flex; align-items: center; gap: 6px;
    background: var(--primary); color: #fff; border: none;
    padding: 0 20px; height: var(--nav-h);
    font-family: var(--font); font-weight: 600; font-size: 13px;
    cursor: pointer; transition: var(--transition);
    white-space: nowrap;
}
.nav-cat-trigger:hover { background: var(--primary-dark); }

.nav-cat-menu {
    position: absolute; top: 100%; left: 0;
    width: 280px; background: #fff; border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg); display: none; z-index: 100;
    max-height: 480px; overflow-y: auto;
}
.nav-categories-dropdown:hover .nav-cat-menu,
.nav-cat-menu.active { display: block; }

.nav-cat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; color: var(--text) !important;
    font-size: 13px; transition: var(--transition);
    border-bottom: 1px solid var(--border);
}
.nav-cat-item:last-child { border-bottom: none; }
.nav-cat-item:hover { background: var(--body-bg); color: var(--primary) !important; padding-left: 20px; }
.nav-cat-item i { width: 16px; text-align: center; font-size: 12px; color: var(--text-light); }

.nav-menu {
    display: flex; align-items: center; list-style: none;
    margin: 0; padding: 0; gap: 0;
}

.nav-link {
    display: flex; align-items: center; gap: 4px;
    color: rgba(255,255,255,.8) !important;
    padding: 0 16px; height: var(--nav-h); line-height: var(--nav-h);
    font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: var(--transition); position: relative;
}
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0;
    height: 2px; background: var(--primary-light);
    transition: var(--transition); transform: translateX(-50%);
}
.nav-link:hover, .nav-link.active { color: #fff !important; }
.nav-link:hover::after, .nav-link.active::after { width: 60%; }

.nav-badge {
    background: var(--accent); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 2px 6px; border-radius: 50px;
}

/* ═══ BREADCRUMBS ═══ */
.breadcrumb-bar { background: #fff; border-bottom: 1px solid var(--border); padding: 8px 0; }
.breadcrumb { margin: 0; font-size: 12px; }
.breadcrumb-item a { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-light); }
.breadcrumb-item+.breadcrumb-item::before { color: var(--text-light); }

/* ═══ PRODUCT CARDS ═══ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    display: flex; flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.product-card-img {
    position: relative; overflow: hidden;
    padding-top: 100%; /* Square aspect ratio */
    background: var(--body-bg);
}
.product-card-img img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; padding: 16px;
    transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.product-card:hover .product-card-img img { transform: scale(1.08); }

.product-card-badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    display: flex; flex-direction: column; gap: 4px;
}
.badge-label {
    padding: 3px 10px; border-radius: 50px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
}
.badge-featured { background: var(--primary); color: #fff; }
.badge-offer { background: var(--accent); color: #fff; }
.badge-new { background: var(--success); color: #fff; }

.product-card-body {
    padding: 14px 16px; flex: 1;
    display: flex; flex-direction: column;
}

.product-card-code {
    font-size: 11px; color: var(--text-light);
    font-weight: 500; margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .5px;
}

.product-card-name {
    font-size: 14px; font-weight: 600; color: var(--text);
    line-height: 1.4; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-name a { color: inherit; }
.product-card-name a:hover { color: var(--primary); }

.product-card-price {
    font-size: 16px; font-weight: 700; color: var(--primary);
    margin-top: auto; margin-bottom: 10px;
}
.product-card-price .old-price {
    font-size: 12px; color: var(--text-light);
    text-decoration: line-through; font-weight: 400;
    margin-left: 6px;
}

.product-card-actions {
    display: flex; gap: 6px;
}
.product-card-actions .btn { flex: 1; font-size: 12px; font-weight: 600; border-radius: var(--radius-sm); }

/* ═══ PRODUCT DETAIL ═══ */
.product-detail { padding: 40px 0; }
.product-gallery { position: relative; }

.gallery-main {
    width: 100%; aspect-ratio: 1; background: #fff;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.gallery-main img { max-width: 90%; max-height: 90%; object-fit: contain; }

.gallery-thumbs {
    display: flex; gap: 8px; margin-top: 12px; overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    width: 72px; height: 72px; flex-shrink: 0;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; overflow: hidden; transition: var(--transition);
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }

.product-info { padding-left: 20px; }
.product-info h1 { font-size: 26px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.product-code { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }

.product-price-box {
    background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
    padding: 16px 20px; border-radius: var(--radius); margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}
.product-price-box .price { font-size: 28px; font-weight: 800; color: var(--primary); }

.product-description { margin-bottom: 24px; color: var(--text); line-height: 1.8; }

.add-to-cart-form {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.qty-selector {
    display: flex; align-items: center; border: 2px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
}
.qty-selector button {
    width: 40px; height: 40px; border: none; background: var(--body-bg);
    cursor: pointer; font-size: 16px; transition: var(--transition);
}
.qty-selector button:hover { background: var(--primary); color: #fff; }
.qty-selector input {
    width: 60px; height: 40px; border: none; text-align: center;
    font-weight: 600; font-family: var(--font); font-size: 15px;
}

/* ═══ CATEGORY SIDEBAR ═══ */
.category-sidebar .cat-list { list-style: none; padding: 0; }
.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; color: var(--text); font-size: 13px; font-weight: 500;
}
.cat-list li a:hover { color: var(--primary); }
.cat-list li a .count {
    background: var(--body-bg); padding: 2px 8px;
    border-radius: 50px; font-size: 11px; color: var(--text-light);
}

/* ═══ SECTIONS / HERO ═══ */
.hero-section { position: relative; overflow: hidden; }
.hero-slide {
    min-height: 420px; display: flex; align-items: center;
    background-size: cover; background-position: center;
    position: relative;
}
.hero-slide::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.6) 0%, transparent 70%);
}
.hero-content {
    position: relative; z-index: 2; color: #fff; max-width: 560px;
    padding: 40px;
}
.hero-content h2 { font-size: 38px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-content p { font-size: 16px; opacity: .9; margin-bottom: 20px; }

.section-title {
    font-size: 24px; font-weight: 700; margin-bottom: 24px;
    position: relative; padding-bottom: 12px;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 48px; height: 3px; background: var(--primary);
    border-radius: 2px;
}
.section-title.center { text-align: center; }
.section-title.center::after { left: 50%; transform: translateX(-50%); }

.section-block { padding: 48px 0; }
.section-block:nth-child(even) { background: #fff; }

/* ═══ CATEGORY GRID ═══ */
.categories-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.category-card {
    background: #fff; border-radius: var(--radius);
    padding: 24px 16px; text-align: center;
    border: 1px solid var(--border); transition: var(--transition);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.category-card:hover {
    border-color: var(--primary); transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.category-card i { font-size: 32px; color: var(--primary); }
.category-card span { font-weight: 600; font-size: 13px; color: var(--text); }

/* ═══ CART / QUOTATION ═══ */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { font-size: 12px; text-transform: uppercase; color: var(--text-light); padding: 12px 8px; border-bottom: 2px solid var(--border); }
.cart-table td { padding: 16px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-product-info { display: flex; align-items: center; gap: 12px; }
.cart-product-info img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); background: var(--body-bg); }

.quotation-form { background: #fff; border-radius: var(--radius); padding: 30px; border: 1px solid var(--border); }
.quotation-form .form-label { font-weight: 600; font-size: 13px; }
.quotation-form .form-control { border-radius: var(--radius-sm); border: 1.5px solid var(--border); padding: 10px 14px; font-size: 14px; transition: var(--transition); }
.quotation-form .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(52,152,219,.1); }

/* ═══ BLOG ═══ */
.blog-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); transition: var(--transition);
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-card-img { height: 200px; overflow: hidden; }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.blog-card:hover .blog-card-img img { transform: scale(1.05); }
.blog-card-body { padding: 20px; }
.blog-card-body h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.blog-card-body p { font-size: 13px; color: var(--text-light); }
.blog-card-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }

/* ═══ CONTACT ═══ */
.contact-box {
    background: linear-gradient(135deg, var(--dark) 0%, #2c3e50 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 48px;
}
.contact-box h3 { font-size: 28px; font-weight: 700; margin-bottom: 20px; }
.contact-info-item { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.contact-info-item i { font-size: 20px; color: var(--primary-light); margin-top: 4px; }

/* ═══ BUTTONS ═══ */
.btn-primary {
    background: var(--primary); border-color: var(--primary); font-weight: 600;
    border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52,152,219,.3); }

.btn-dark {
    background: var(--dark); border-color: var(--dark); font-weight: 600;
    border-radius: var(--radius-sm);
}
.btn-dark:hover { background: var(--darker); transform: translateY(-1px); }

.btn-outline-primary {
    border: 2px solid var(--primary); color: var(--primary); font-weight: 600;
    border-radius: var(--radius-sm);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-lg { padding: 12px 28px; font-size: 15px; }

/* ═══ WHATSAPP FLOAT ═══ */
.whatsapp-float {
    position: fixed; bottom: 24px; right: 24px;
    width: 56px; height: 56px;
    background: #25d366; color: #fff !important;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 28px; z-index: 9999;
    box-shadow: 0 4px 20px rgba(37,211,102,.4);
    transition: var(--transition);
    animation: pulse-wa 2s infinite;
}
.whatsapp-float:hover { transform: scale(1.1); color: #fff !important; }

@keyframes pulse-wa {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); }
    50% { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
}

/* ═══ BACK TO TOP ═══ */
.back-to-top {
    position: fixed; bottom: 24px; right: 90px;
    width: 44px; height: 44px;
    background: var(--dark); color: #fff; border: none;
    border-radius: 50%; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    z-index: 9998; transition: var(--transition);
    box-shadow: var(--shadow);
}
.back-to-top.visible { display: flex; }
.back-to-top:hover { background: var(--primary); transform: translateY(-2px); }

/* ═══ FOOTER ═══ */
.site-footer { padding-top: 48px; }

.footer-grid {
    display: grid; grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 32px; padding-bottom: 32px;
}

.footer-title {
    font-size: 15px; font-weight: 700; margin-bottom: 16px;
    text-transform: uppercase; letter-spacing: 1px;
}

.footer-contact { list-style: none; padding: 0; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.footer-contact li i { margin-top: 3px; width: 16px; opacity: .7; }
.footer-contact li a { color: inherit; }
.footer-contact li a:hover { color: var(--primary-light); }

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links li a { color: inherit; font-size: 13px; transition: var(--transition); }
.footer-links li a:hover { color: var(--primary-light); padding-left: 4px; }

.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.social-icon {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,.08); color: inherit;
    font-size: 16px; transition: var(--transition);
}
.social-icon:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

.footer-logo { filter: brightness(0) invert(1); opacity: .8; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }

/* ═══ ALERTS ═══ */
.alert { border-radius: var(--radius-sm); border: none; font-size: 14px; font-weight: 500; }

/* ═══ PAGINATION ═══ */
.pagination .page-item .page-link {
    border-radius: var(--radius-sm); margin: 0 3px;
    font-weight: 600; font-size: 13px; color: var(--text);
    border: 1px solid var(--border); padding: 8px 14px;
}
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }
.pagination .page-item .page-link:hover { background: var(--body-bg); }

/* ═══ LOADING SKELETON ═══ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══ EMPTY STATES ═══ */
.empty-state {
    text-align: center; padding: 60px 20px;
}
.empty-state i { font-size: 48px; color: var(--text-light); margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p { color: var(--text-light); }

/* ═══ ANIMATIONS ═══ */
.fade-in { animation: fadeIn .5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp .6s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 991.98px) {
    .header-search { display: none; }
    .nav-inner { flex-wrap: wrap; height: auto; }
    .nav-menu {
        display: none; flex-direction: column; width: 100%;
        padding: 8px 0;
    }
    .nav-menu.open { display: flex; }
    .nav-link { height: 44px; line-height: 44px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .product-info { padding-left: 0; margin-top: 24px; }
}

@media (max-width: 767.98px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card-body { padding: 10px 12px; }
    .product-card-name { font-size: 13px; }
    .hero-content h2 { font-size: 24px; }
    .hero-slide { min-height: 300px; }
    .section-block { padding: 32px 0; }
    .section-title { font-size: 20px; }
    .cart-label { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .contact-box { padding: 28px 20px; }
}

@media (max-width: 575.98px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card-img { padding-top: 100%; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .category-card { padding: 16px 8px; }
    .category-card span { font-size: 11px; }
}

/* ═══ PRINT ═══ */
@media print {
    .site-header, .main-nav, .site-footer, .whatsapp-float, .back-to-top { display: none !important; }
    .site-main { padding: 0; }
}
