/* pharmrus template — modern pharmacy style
   Loads Bootstrap 5 from CDN then adds custom pharmacy styling */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Modern pharmacy palette — calm teal + soft navy */
    --brand: #0d8e6f;          /* medical teal — спокойный, профессиональный */
    --brand-dark: #086e56;     /* hover/active для brand */
    --brand-light: #e6f5ef;    /* tints backgrounds */
    --accent: #2563eb;         /* deep blue для ссылок и акцентов */
    --accent-dark: #1d4ed8;
    --pharm-dark: #0f2942;     /* navy для текста/headers */
    --pharm-light: #f5f9f7;    /* мягкий фон */
    --pharm-gray: #6b7280;     /* Tailwind gray-500 */
    --pharm-gray-light: #f3f4f6;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;             /* Tailwind gray-800 — мягче для чтения */
    background: #ffffff;
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }

/* Topbar */
.topbar { font-size: 13px; }
.topbar a { color: #fff; opacity: .9; }
.topbar a:hover { opacity: 1; color: #fff; }
.topbar .moduletable { margin: 0; }
.topbar ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; }
.topbar ul li a { display: inline-flex; align-items: center; gap: 4px; }

/* Header */
.site-header { border-bottom: 1px solid #e9ecef; }
.brand { font-weight: 700; }
.brand-icon { font-weight: 700; }

/* Main Menu */
.main-menu .navbar-nav { width: 100%; }
.main-menu .nav-item > a.nav-link {
    color: var(--pharm-dark);
    font-weight: 600;
    padding: 12px 18px !important;
    border-radius: 8px;
    transition: all .2s;
}
.main-menu .nav-item > a.nav-link:hover,
.main-menu .nav-item.active > a.nav-link {
    color: var(--brand);
    background: var(--pharm-light);
}
.main-menu .dropdown-menu {
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    border-radius: 10px;
}
.main-menu .dropdown-item { padding: 8px 16px; border-radius: 6px; margin: 2px; }
.main-menu .dropdown-item:hover { background: var(--pharm-light); color: var(--brand); }

/* Search */
.search .moduletable { margin: 0; }
.search form { display: flex; gap: 6px; }
.search input[type="text"],
.search input[type="search"] {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 14px;
    transition: border-color .2s;
}
.search input:focus { border-color: var(--brand); outline: none; }
.search button, .search input[type="submit"] {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.search button:hover { background: var(--brand-dark); }

/* Breadcrumbs */
.breadcrumbs-wrap { font-size: 13px; }
.breadcrumbs-wrap ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; }
.breadcrumbs-wrap li::after { content: '/'; margin-left: 6px; color: var(--pharm-gray); }
.breadcrumbs-wrap li:last-child::after { content: ''; }
.breadcrumbs-wrap a { color: var(--pharm-gray); }
.breadcrumbs-wrap .active { color: var(--pharm-dark); font-weight: 600; }

/* Hero / Slide */
.hero-section { background: linear-gradient(135deg, var(--pharm-light) 0%, #e8f5e9 100%); }
.hero-section .moduletable { margin: 0; }
.hero-section img { max-width: 100%; height: auto; display: block; }

/* Sidebar */
.sidebar-left .sidebar-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.sidebar-left .moduletable { margin-bottom: 16px; }
.sidebar-left .moduletable:last-child { margin-bottom: 0; }
.sidebar-left h3.mod-title,
.sidebar-left .moduletable h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--pharm-dark);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand);
}

/* Category tree menu */
.sidebar-left .mod_vina_treeview_virtuemart ul,
.sidebar-left ul.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-left .mod_vina_treeview_virtuemart li a,
.sidebar-left ul.nav-list li a {
    display: block;
    padding: 8px 12px;
    color: var(--pharm-dark);
    border-radius: 6px;
    font-size: 14px;
    transition: all .15s;
}
.sidebar-left .mod_vina_treeview_virtuemart li a:hover,
.sidebar-left ul.nav-list li a:hover {
    background: var(--pharm-light);
    color: var(--brand);
    padding-left: 16px;
}

/* VM list menus in sidebar */
.vm-list-menus .moduletable { margin-bottom: 12px; }

/* Module title styling */
.moduletable h3,
.moduletable .mod-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--pharm-dark);
    margin-bottom: 16px;
    position: relative;
    padding-left: 14px;
}
.moduletable h3::before,
.moduletable .mod-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--brand);
    border-radius: 2px;
}

/* Product sections */
.product-section,
.feature-row .moduletable,
.home2-layout .moduletable,
.home3-layout .moduletable,
.home4-layout .moduletable {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* VirtueMart product cards */
.vm-product,
.product-container,
.browse-view .product {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all .25s;
    height: 100%;
}
.vm-product:hover,
.product-container:hover,
.browse-view .product:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-2px);
    border-color: var(--brand);
}
.vm-product img,
.product-container img { max-width: 100%; height: auto; border-radius: 6px; margin-bottom: 10px; }
.vm-product .product-title,
.vm-product h3 { font-size: 14px; font-weight: 600; margin: 8px 0; }
.vm-product .product-price,
.vm-product .PricesalesPrice { color: var(--brand); font-weight: 700; font-size: 16px; }
.vm-product .addtocart-bar,
.vm-product .addtocart { margin-top: 10px; }
.vm-product .addtocart-button,
.vm-product input.addtocart-button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.vm-product .addtocart-button:hover,
.vm-product input.addtocart-button:hover { background: #168032; }

/* Carousel / ticker modules */
.mod_pharmrus_carousel_virtuemart,
.mod_pharmrus_ticker_virtuemart { position: relative; }
.mod_pharmrus_carousel_virtuemart .carousel-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.mod_pharmrus_carousel_virtuemart .carousel-track > * { flex: 0 0 220px; scroll-snap-align: start; }
.mod_pharmrus_ticker_virtuemart .ticker-track { display: flex; gap: 16px; animation: ticker-scroll 30s linear infinite; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Component wrapper */
.component-wrapper { min-height: 400px; }
.component-wrapper .vm-layout {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
}
/* VM category view */
.category-view .category {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all .25s;
}
.category-view .category:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: var(--brand);
}

/* Bottom section */
.bottom-section { font-size: 14px; }
.bottom-section h3.mod-title,
.bottom-section .moduletable h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}
.bottom-section .moduletable h3::before { display: none; }
.bottom-section a { color: #b0bec5; }
.bottom-section a:hover { color: #fff; }
.bottom-section ul { list-style: none; padding: 0; margin: 0; }
.bottom-section ul li { padding: 4px 0; }
.bottom-section p { color: #b0bec5; }

/* Contact form */
.mod_qlform form { display: grid; gap: 10px; }
.mod_qlform input, .mod_qlform textarea {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
}
.mod_qlform input::placeholder, .mod_qlform textarea::placeholder { color: #90a4ae; }

/* Footer */
.site-footer { font-size: 13px; }
.site-footer .moduletable { margin: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer a { color: #90a4ae; }
.site-footer a:hover { color: #fff; }

/* AcyMailing newsletter */
.mod_acymailing form { display: flex; gap: 6px; }
.mod_acymailing input[type="email"] {
    flex: 1;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
}
.mod_acymailing button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Custom HTML modules */
.mod_custom p { margin: 0 0 8px; }
.mod_custom img { max-width: 100%; height: auto; border-radius: 8px; }

/* SP Page Builder / SP Simple Portfolio */
.mod_sppagebuilder,
.mod_spsimpleportfolio { margin: 0; }

/* VM Cart module */
.mod_virtuemart_cart .vmCartModule {
    background: var(--pharm-light);
    border-radius: 20px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pharm-dark);
}
.mod_virtuemart_cart .vmCartModule:hover { background: #d4ead4; }

/* VirtueMart general styling */
.vm-layout .vm-product-details,
.vm-layout .productdetails-view { padding: 20px; }
.vm-layout .productdetails-view .product-title,
.vm-layout h1 { font-size: 24px; font-weight: 700; color: var(--pharm-dark); margin-bottom: 16px; }
.vm-layout .productdetails-view .product-price,
.vm-layout .product-price { color: var(--brand); font-size: 20px; font-weight: 700; }
.vm-layout .addtocart-bar,
.vm-layout .addtocart { margin: 16px 0; }
.vm-layout .addtocart-button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Pagination */
.pagination { justify-content: center; margin: 20px 0; }
.pagination .page-item .page-link {
    color: var(--pharm-dark);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* System messages */
#system-message-container .alert {
    border-radius: 8px;
    border: none;
    padding: 12px 16px;
    margin-bottom: 16px;
}
#system-message-container .alert-info { background: #e3f2fd; color: #0d47a1; }
#system-message-container .alert-success { background: #e8f5e9; color: #1b5e20; }
#system-message-container .alert-warning { background: #fff8e1; color: #e65100; }
#system-message-container .alert-error { background: #ffebee; color: #b71c1c; }

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar-left { order: 2; }
    .main-content, #main-content { order: 1; }
    .main-menu .navbar-collapse { padding-top: 12px; }
}

@media (max-width: 767.98px) {
    body { font-size: 14px; }
    .topbar { font-size: 12px; }
    .moduletable h3 { font-size: 16px; }
    .vm-product,
    .product-container { padding: 12px; }
    .bottom-section .col-md-3 { margin-bottom: 16px; }
}

/* Utility */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.visually-hidden-focusable:focus {
    position: fixed; top: 0; left: 0;
    background: var(--brand); color: #fff;
    padding: 12px 20px; border-radius: 0 0 8px 0;
    z-index: 9999;
}

/* Carousel navigation buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(27,158,62,.9);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background .2s;
}
.carousel-nav:hover { background: var(--brand); }
.carousel-prev { left: -10px; }
.carousel-next { right: -10px; }

/* === Brand Carousel === */
.brand-carousel-section { background:#f8fafb !important; }
.brand-carousel-wrap { overflow:hidden; position:relative; }
.brand-carousel-track {
    display:flex; gap:24px; overflow-x:auto; scroll-snap-type:x mandatory;
    padding:12px 0; scrollbar-width:thin;
}
.brand-carousel-track::-webkit-scrollbar { height:6px; }
.brand-carousel-track::-webkit-scrollbar-track { background:#e9ecef; border-radius:3px; }
.brand-carousel-track::-webkit-scrollbar-thumb { background:var(--brand); border-radius:3px; }
.brand-item {
    flex:0 0 160px; scroll-snap-align:start;
    background:#fff; border:1px solid #e9ecef; border-radius:10px;
    padding:16px; text-align:center;
    transition:all .25s; display:flex; align-items:center; justify-content:center;
    min-height:80px;
}
.brand-item:hover {
    box-shadow:0 4px 16px rgba(0,0,0,.1);
    border-color:var(--brand);
    transform:translateY(-2px);
}
.brand-item img { max-width:100%; max-height:60px; object-fit:contain; filter:grayscale(40%); transition:filter .25s; }
.brand-item:hover img { filter:grayscale(0); }

/* === Hero Section === */
.hero-section { background:transparent; }
.hero-default { border-radius:0; overflow:hidden; }
.hero-banner-wrapper img {
    width:100%; max-height:380px; object-fit:cover; border-radius:12px;
    box-shadow:0 4px 24px rgba(0,0,0,.08);
    transition:transform .3s;
}
.hero-banner-wrapper:hover img { transform:scale(1.01); }

/* === Site Logo === */
.site-logo { transition:transform .2s; }
.site-logo:hover { transform:scale(1.03); }

/* === Currency/Cart in header === */
.header-extras .mod_virtuemart_currencies select,
.header-extras .mod_virtuemart_cart { font-size:13px; }
.header-extras .mod_virtuemart_currencies select {
    border:1px solid #e9ecef; border-radius:20px; padding:6px 12px;
    background:#fff; color:var(--pharm-dark);
}

/* === VM Product price styling (modern) === */
.vm-product .product-price,
.browse-view .product .product-price,
.PricesalesPrice {
    color:var(--brand) !important; font-weight:700; font-size:18px;
}
.vm-product .PricebasePrice,
.browse-view .product .PricebasePrice {
    color:#999; text-decoration:line-through; font-size:14px; font-weight:400;
}

/* === Featured/Special/New product sections === */
.product-section .moduletable,
.feature-row .moduletable {
    background:#fff; border:1px solid #e9ecef; border-radius:12px;
    padding:20px; box-shadow:0 2px 8px rgba(0,0,0,.04);
}
.product-section .moduletable h3,
.feature-row .moduletable h3 {
    font-size:20px; font-weight:700; color:var(--pharm-dark);
    border-bottom:2px solid var(--brand); padding-bottom:12px;
    margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.product-section .moduletable h3::before { content:'\F477'; font-family:'bootstrap-icons'; color:var(--brand); }

/* === Sale badges === */
.vm-product .onsale,
.browse-view .product .onsale,
.product-discount {
    background:#e53935; color:#fff; font-size:11px; font-weight:700;
    padding:3px 10px; border-radius:12px; display:inline-block;
    position:absolute; top:8px; right:8px;
}

/* === Footer copyright === */
.site-footer .copyright { border-top:1px solid rgba(255,255,255,.08); padding-top:12px; margin-top:12px; }

/* === Back to top button === */
#back-to-top {
    position:fixed; bottom:20px; right:20px; z-index:999;
    background:var(--brand); color:#fff; border:none;
    width:44px; height:44px; border-radius:50%; cursor:pointer;
    font-size:20px; box-shadow:0 4px 12px rgba(0,0,0,.15);
    opacity:0; transition:opacity .3s; display:flex; align-items:center; justify-content:center;
}
#back-to-top.visible { opacity:1; }
#back-to-top:hover { background:#168032; transform:translateY(-2px); }

/* === Main Navigation Menu (mod_menu navbar-nav) === */
.main-menu .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-menu .navbar-nav > li {
    position: relative;
}
.main-menu .navbar-nav > li > a {
    display: block;
    padding: 12px 18px;
    color: var(--pharm-dark);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: all .2s;
    white-space: nowrap;
}
.main-menu .navbar-nav > li > a:hover,
.main-menu .navbar-nav > li.active > a {
    color: var(--brand);
    background: var(--pharm-light);
}
.main-menu .navbar-nav > li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 8px;
    list-style: none;
    margin: 4px 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s;
    z-index: 1000;
}
.main-menu .navbar-nav > li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.main-menu .navbar-nav > li > ul > li > a {
    display: block;
    padding: 8px 14px;
    color: var(--pharm-dark);
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    transition: all .15s;
}
.main-menu .navbar-nav > li > ul > li > a:hover {
    background: var(--pharm-light);
    color: var(--brand);
    padding-left: 18px;
}

/* === Responsive: Tablet (≤991px) === */
@media (max-width: 991.98px) {
    .main-menu .navbar-collapse {
        flex-basis: 100%;
    }
    .main-menu .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    .main-menu .navbar-nav > li {
        width: 100%;
    }
    .main-menu .navbar-nav > li > a {
        padding: 10px 14px;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-menu .navbar-nav > li > ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 16px;
        background: transparent;
    }
    .site-header .row {
        flex-direction: column;
    }
    .site-header .col-lg-3,
    .site-header .col-lg-6,
    .site-header .col-lg-3 {
        width: 100%;
        text-align: center;
    }
    .header-extras {
        justify-content: center !important;
    }
}

/* === Responsive: Mobile (≤767px) === */
@media (max-width: 767.98px) {
    body { font-size: 14px; }
    .topbar { font-size: 11px; padding: 4px 0; }
    .topbar .d-flex { flex-direction: column; gap: 4px; }
    .site-logo { max-height: 40px !important; }
    .hero-banner-wrapper img { max-height: 220px; }
    .main-section { padding: 12px 0; }
    .sidebar-left { order: 2; margin-top: 16px; }
    #main-content { order: 1; }
    .product-section .moduletable,
    .feature-row .moduletable {
        padding: 12px;
    }
    .brand-item {
        flex: 0 0 120px;
        padding: 10px;
    }
    .brand-item img { max-height: 40px; }
    .bottom-section .col-md-3 { width: 100%; margin-bottom: 16px; }
    .bottom-section { padding: 20px 0 !important; }
    .site-footer .col-md-3 { width: 100%; text-align: center; margin-bottom: 8px; }
    .navbar-toggler { font-size: 20px; padding: 4px 10px; }
    #back-to-top { width: 38px; height: 38px; font-size: 16px; bottom: 12px; right: 12px; }
}

/* === Responsive: Very small (≤480px) === */
@media (max-width: 480px) {
    .container { padding-left: 10px; padding-right: 10px; }
    .moduletable h3 { font-size: 15px; }
    .vm-product { padding: 10px; }
    .search input[type="text"],
    .search input[type="search"] { font-size: 13px; padding: 8px 14px; }
}
