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

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --secondary: #3aab34;
    --red: #de1d27;
    --accent: #f59e0b;
    --dark: #0f172a;
    --slate-800: #1e293b;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --glass: rgba(255, 255, 255, 0.8);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #fcfcfd;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .logo {
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-container {
    padding: 40px 0;
}

@media (max-width: 1240px) {
    .container {
        padding: 0 20px;
    }
}

/* Header & Navigation */
header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background: var(--dark);
    color: var(--white);
    font-size: 12px;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav {
    padding: 20px 0;
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--dark);
}

.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 12px 20px;
    padding-right: 50px;
    border: 2px solid var(--slate-100);
    border-radius: 50px;
    background: var(--slate-100);
    transition: var(--transition);
    outline: none;
}

.search-container input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

.search-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary);
    font-size: 18px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    position: relative;
}

.action-item i {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 2px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--red);
    color: var(--white);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 24px;
    color: var(--dark);
    cursor: pointer;
}

/* Category Menu */
.category-nav {
    background: var(--white);
    border-top: 1px solid var(--slate-200);
    display: flex;
    justify-content: center;
}

.category-nav .container {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .category-nav .container {
        overflow-x: auto;
    }
}

.category-list {
    display: flex;
    gap: 30px;
}

.category-item {
    padding: 15px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.category-item:hover, .category-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Category Dropdown (Integralmed Style) */
.shop-by-category {
    position: relative;
    padding: 15px 25px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 8px 8px 0 0;
    border-bottom: none !important;
}

.shop-by-category:hover {
    color: var(--white) !important;
    background: var(--primary-dark);
}

.shop-by-category:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    background: var(--white);
    border: 1px solid var(--slate-200);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-radius: 0 0 8px 8px;
    color: var(--text-main);
    z-index: 1000;
    display: none;
    padding: 10px 0;
}

.dropdown-menu ul {
    list-style: none;
    white-space: normal; /* Override the nowrap from the parent */
}

.dropdown-menu li {
    border-bottom: 1px solid var(--slate-100);
}

.dropdown-menu li:last-child {
    border-bottom: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary);
    padding-left: 28px; /* Subtle sweep animation */
}

/* Hero Section */
.hero {
    padding: 40px 0;
}

.hero-banner {
    background: linear-gradient(135deg, #075985 0%, #0369a1 100%);
    border-radius: 30px;
    padding: 60px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(2, 132, 199, 0.15);
}

.hero-content {
    max-width: 500px;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-content p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.btn-white {
    background: var(--white);
    color: var(--primary);
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-block;
    box-shadow: var(--shadow-lg);
}

.hero-img {
    width: 40%;
    transform: scale(1.1);
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
}

/* Section Titles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
}

.view-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

/* Default 4 columns on desktop (Home) */
@media (min-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Enforce 3 columns on sidebar layouts for Desktop */
@media (min-width: 993px) {
    .category-layout .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Category Layout (Sidebar + Grid) */
.category-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.category-content {
    overflow: hidden;
}

.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--slate-100);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
}

/* Accordion Sidebar */
.accordion-item {
    border: 1px solid var(--slate-100);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    background: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: var(--slate-50);
}

.accordion-header i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: #fff;
}

.accordion-item.active .accordion-content {
    max-height: 400px; /* Allow scroll for long lists */
    overflow-y: auto;
    padding: 10px 20px 20px;
}

/* Custom Radio style like Integralmed */
.filter-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-radio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
}

.filter-radio-item input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--slate-200);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-radio-item input[type="radio"]:checked {
    border-color: var(--primary);
}

.filter-radio-item input[type="radio"]:checked::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.filter-radio-item:hover {
    color: var(--primary);
}


.popular-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--slate-50);
    padding-bottom: 15px;
}

.popular-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid var(--slate-100);
    border-radius: 4px;
    padding: 5px;
}

.popular-item-info h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-item-price {
    color: var(--red);
    font-weight: 700;
    font-size: 14px;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px 0 0; /* Bottom padding removed for full-width button */
    border: 1px solid var(--slate-100);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-card .container-inner {
    padding: 0 15px 15px;
    text-align: center;
    flex-grow: 1;
}

.product-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    margin-bottom: 15px;
    padding: 10px;
}

.product-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #383838;
    text-align: center;
    height: 40px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-box {
    margin: 15px 0;
    text-align: left;
}

.price-main {
    color: var(--red);
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.price-old {
    font-size: 13px;
    color: #757575;
    text-decoration: line-through;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.card-tech-info {
    text-align: left;
    font-size: 13px;
    color: #757575;
    margin-top: 15px;
}

.tech-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.tech-info-item i {
    color: #3aab34;
    font-size: 14px;
}

.btn-card-add {
    background: #3aab34;
    color: var(--white);
    width: 100%;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    margin-top: auto;
}

.discount-badge {
    position: absolute;
    top: 20px;
    right: 0;
    background: var(--red);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px 0 0 4px;
    z-index: 2;
}

/* Pagination */
.pagination {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-main);
    background: var(--white);
    transition: var(--transition);
}

.pagination a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination a:hover:not(.active) {
    background: var(--slate-100);
}

/* Responsive */
/* Mobile Sidebar Styles */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--white);
    z-index: 2000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
}

.mobile-sidebar.active {
    left: 0;
}

.mobile-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-sidebar {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.mobile-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-search {
    margin-bottom: 30px;
}

.mobile-search form {
    position: relative;
}

.mobile-search input {
    width: 100%;
    padding: 12px 15px;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    outline: none;
}

.mobile-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary);
}

.mobile-menu-title {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 15px;
    font-weight: 700;
}

.mobile-cat-list {
    margin-bottom: 30px;
}

.mobile-cat-list li {
    margin-bottom: 5px;
}

.mobile-cat-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
}

.mobile-cat-list a i {
    font-size: 12px;
    color: var(--slate-300);
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .category-layout {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 0;
    }
    .sidebar {
        display: none; /* Hide sidebar on mobile in category pages */
    }
    .hero-banner {
        padding: 40px;
    }
    .hero-content h1 {
        font-size: 32px;
    }
    .hero-img {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .category-nav {
        display: none; /* Hide top category nav on mobile */
    }

    .container {
        padding: 0 10px;
    }

    .top-bar {
        font-size: 10px;
        padding: 5px 0;
    }

    .top-bar .container {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }

    .main-nav {
        padding: 15px 0;
    }

    .main-nav .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 15px;
    }

    .logo {
        justify-content: center;
        font-size: 22px;
    }

    .search-container {
        display: none; /* Hide main search on mobile, using sidebar search */
    }

    .nav-actions {
        justify-content: flex-end;
        gap: 15px;
    }

    .action-item span {
        display: none; /* Only show icons on mobile header */
    }

    .hero-banner {
        padding: 30px 20px;
        text-align: center;
        border-radius: 16px;
        margin: 0 10px;
    }

    .hero-content h1 {
        font-size: 24px;
    }

    .section-header {
        padding: 0;
        margin-bottom: 15px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 0 40px;
    }

    .product-card .container-inner {
        padding: 0 8px 8px;
    }

    .product-name {
        font-size: 13px;
        height: 34px;
        margin-bottom: 10px;
    }

    .price-main {
        font-size: 16px;
    }

    .card-tech-info {
        display: none; /* Hide tech info on mobile cards to save space */
    }

    .section-container {
        padding: 20px 0;
    }

    /* Override inline padding-top from HTML on mobile */
    [style*="padding-top: 40px"] {
        padding-top: 15px !important;
    }

    .btn-card-add {
        font-size: 10px;
        padding: 10px 5px;
    }
    
    .discount-badge {
        top: 10px;
        font-size: 10px;
        padding: 2px 6px;
    }
    .product-card {
        padding-top: 10px;
    }
}

/* Product Detail Page Responsive */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 60px;
}

.product-visuals {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid var(--slate-100);
    text-align: center;
}

.product-visuals img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.product-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.description-content {
    font-size: 15px; 
    color: var(--text-main); 
    line-height: 1.8;
    overflow-x: auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

.description-content img, 
.description-content table {
    max-width: 100% !important;
    height: auto !important;
}

.product-meta-items {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--slate-100);
}

.pricing-card {
    background: var(--slate-100);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.product-description {
    margin-top: 50px;
    padding: 40px;
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: 20px;
}

@media (max-width: 1024px) {
    .product-detail-layout {
        gap: 30px;
        grid-template-columns: 1fr 350px;
    }
}

@media (max-width: 768px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-visuals {
        padding: 20px;
        border-radius: 12px;
    }

    .product-visuals img {
        max-height: 300px;
    }

    .product-info h1 {
        font-size: 24px !important;
        margin-bottom: 15px !important;
    }

    .product-meta-items {
        gap: 15px;
        margin-bottom: 20px;
    }

    .pricing-card {
        padding: 20px;
        border-radius: 12px;
    }

    .product-description {
        margin-top: 30px;
        padding: 20px;
        border-radius: 12px;
    }

    .product-description h2 {
        font-size: 20px;
        margin-bottom: 15px !important;
    }
}

