/* ============================================
   Dymovody.sk
   ============================================ */

:root {
    --accent: #ea580c;
    --accent-hover: #dc4a04;
    --accent-50: #fff7ed;
    --accent-100: #ffedd5;
    --accent-200: #fed7aa;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    --gray-950: #0a0a0a;

    --white: #ffffff;

    --shadow-xs: 0 1px 2px rgb(0 0 0 / .05);
    --shadow-sm: 0 1px 3px rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);
}

/* --- Base --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.6;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.15;
    color: var(--gray-900);
    letter-spacing: -.025em;
}

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Navbar --- */
#mainNav {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid transparent;
    padding-top: .75rem;
    padding-bottom: .75rem;
    transition: background .3s, border-color .3s, box-shadow .3s;
}

#mainNav.navbar-shrink {
    background: rgba(255, 255, 255, .95);
    border-bottom-color: var(--gray-200);
    box-shadow: var(--shadow-xs);
}

#mainNav .navbar-brand {
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--gray-900);
    letter-spacing: -.03em;
    transition: color .2s;
}
#mainNav .navbar-brand:hover { color: var(--accent); }
#mainNav .navbar-brand.disabled { pointer-events: none; cursor: default; }

#mainNav .nav-link {
    color: var(--gray-600);
    font-weight: 500;
    font-size: .8125rem;
    padding: .4rem .625rem;
    border-radius: 6px;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
#mainNav .nav-link:hover,
#mainNav .nav-link:focus {
    color: var(--gray-900);
    background: var(--gray-100);
}

/* dropdown caret */
#mainNav .dropdown-toggle::after {
    border: none;
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23737373'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    vertical-align: .1em;
    margin-left: .25em;
    transition: transform .2s;
}
#mainNav .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

#mainNav .dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xl);
    border-radius: 12px;
    padding: 6px;
    margin-top: 4px;
    animation: dropdownFade .15s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
#mainNav .dropdown-divider {
    margin: 4px 8px;
    border-color: var(--gray-100);
}

#mainNav .dropdown-item {
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 6px;
    padding: .425rem .75rem;
    color: var(--gray-700);
    transition: all .15s;
}
#mainNav .dropdown-item:hover,
#mainNav .dropdown-item:focus {
    background: var(--gray-100);
    color: var(--gray-900);
}

.navbar-toggler {
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 1.25rem;
    padding: .3rem .6rem;
    border-radius: 8px;
    background: var(--white);
    transition: all .15s;
    line-height: 1;
}
.navbar-toggler:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}
.navbar-toggler:focus {
    box-shadow: none;
}

/* --- Hero / Masthead --- */
header.masthead,
header.masthead-smaller {
    position: relative;
    padding: 10rem 0 6rem;
    background: var(--gray-950);
    overflow: hidden;
}

header.masthead::before,
header.masthead-smaller::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://dymovody.sk/assets/img/bg-masthead-small.jpg');
    background-size: cover;
    background-position: center;
    opacity: .25;
}

/* subtle warm gradient overlay */
header.masthead::after,
header.masthead-smaller::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,.3) 0%, rgba(10,10,10,.7) 100%);
    pointer-events: none;
}

header.masthead-smaller {
    padding: 8rem 0 3.5rem;
}

header.masthead > .container,
header.masthead-smaller > .container {
    position: relative;
    z-index: 2;
}

header.masthead h1 {
    font-size: 3rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -.035em;
    line-height: 1.05;
}

header.masthead-smaller h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -.03em;
    line-height: 1.1;
}

.text-white-75 { color: rgba(255, 255, 255, .65) !important; }

header.masthead .text-white a,
header.masthead-smaller .text-white a {
    color: rgba(255, 255, 255, .85);
    transition: color .2s;
}
header.masthead .text-white a:hover,
header.masthead-smaller .text-white a:hover {
    color: var(--white);
}

hr.divider {
    width: 48px;
    height: 4px;
    border: none;
    background: var(--accent);
    margin: 1.25rem auto;
    opacity: 1;
    border-radius: 9999px;
}
hr.divider-light {
    background: rgba(255, 255, 255, .35);
}

/* --- Buttons --- */
.btn-primary {
    background: var(--accent);
    border: none;
    border-radius: 9999px;
    font-weight: 600;
    font-size: .875rem;
    padding: .625rem 1.75rem;
    color: var(--white);
    letter-spacing: -.01em;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.btn-primary:hover,
.btn-primary:focus {
    background: var(--accent-hover);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(234 88 12 / .3);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-xl {
    padding: .75rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.moreDetailButton {
    display: inline-block;
    background: var(--gray-900);
    color: var(--white);
    border: none;
    padding: .45rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: .8rem;
    cursor: pointer;
    letter-spacing: -.01em;
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
.moreDetailButton:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(0 0 0 / .15);
}

/* --- Product Cards --- */
.product .card,
.product.card {
    border: none;
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 1px 3px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .04);
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
    overflow: hidden;
}
.product .card:hover,
.product.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgb(0 0 0 / .08), 0 8px 16px rgb(0 0 0 / .06);
}

.product .card-img-top {
    object-fit: contain;
    padding: 1.5rem 1.5rem .75rem;
    max-height: 200px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.product .card:hover .card-img-top {
    transform: scale(1.04);
}

.product .card-body {
    padding: .75rem 1.25rem 1.25rem;
}

.product-description {
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: .375rem;
    line-height: 1.45;
}
.product-description:last-of-type {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-900);
    letter-spacing: -.02em;
}

/* --- Category Cards --- */
.card-group .card {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--white);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
    margin: .4rem;
}
.card-group .card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.card-group .card-img-top {
    object-fit: contain;
    padding: .75rem;
}

.card-group .card-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-800);
    transition: color .15s;
    letter-spacing: -.01em;
}
.card-group .card-title:hover { color: var(--accent); }

/* --- Products Container --- */
#productsContainer {
    border-radius: 20px;
    padding: 2.5rem 2rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

/* --- Top Products --- */
.top-products {
    background: var(--gray-50);
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

.top-products h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gray-900);
    letter-spacing: -.03em;
    margin-bottom: 2rem !important;
}

/* --- Pagination --- */
.pagination .page-link {
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin: 0 3px;
    font-weight: 600;
    font-size: .85rem;
    padding: .4rem .75rem;
    transition: all .15s;
}
.pagination .page-link:hover {
    background: var(--accent-50);
    border-color: var(--accent-200);
    color: var(--accent);
}
.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 2px 6px rgb(234 88 12 / .25);
}

/* --- Read More / Less --- */
#readMore, #readLess {
    color: var(--accent-200);
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    border: none;
    background: none;
    padding: 0;
    transition: color .2s;
}
#readMore:hover, #readLess:hover {
    color: var(--white);
}
#more { display: none; }

/* --- Back to Top --- */
#backToTopButton {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999;
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    line-height: 42px;
    text-align: center;
    font-size: .85rem;
    padding: 0;
    box-shadow: var(--shadow-lg);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
#backToTopButton:hover {
    background: var(--gray-900);
    color: var(--white);
    border-color: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* --- Chatbox --- */
#chatbox-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    width: auto;
    max-width: 440px;
}

#chatbox-header {
    background: var(--gray-900);
    color: var(--white);
    padding: 14px 20px;
    cursor: pointer;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    transition: all .2s cubic-bezier(.4, 0, .2, 1);
}
#chatbox-header:hover {
    background: var(--accent);
    transform: scale(1.06);
    box-shadow: var(--shadow-2xl);
}

#chatIcon { width: 24px; height: 24px; }

#chatbox-body {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-2xl);
    height: 520px;
    max-height: 70vh;
    padding: 0;
}

#chatbox-messages {
    overflow-y: auto;
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

.chat-bubble {
    padding: .625rem 1rem;
    border-radius: 16px;
    font-size: .875rem;
    line-height: 1.5;
    max-width: 85%;
    margin-bottom: 0;
}
.user-message {
    background: var(--accent);
    color: var(--white);
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
}
.user-message strong { color: var(--white); }
.bot-message {
    background: var(--gray-100);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
}

#chatbox-form {
    display: flex;
    border-top: 1px solid var(--gray-200);
    padding: .75rem;
    gap: .5rem;
    align-items: center;
}
#chatbox-input {
    flex: 1;
    border: 1.5px solid var(--gray-200);
    border-radius: 9999px;
    padding: .65rem 1.125rem;
    font-size: .9rem;
    outline: none;
    background: var(--gray-50);
    transition: all .2s;
    font-family: inherit;
}
#chatbox-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(234 88 12 / .1);
    background: var(--white);
}

#chatbox-form button {
    background: var(--gray-900);
    color: var(--white);
    border: none;
    border-radius: 9999px;
    padding: .65rem 1.375rem;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}
#chatbox-form button:hover {
    background: var(--accent);
}

/* --- Footer --- */
footer {
    background: var(--gray-950);
    color: var(--gray-400);
    padding-top: 3rem !important;
    padding-bottom: 2rem !important;
}
footer p { margin-bottom: .5rem; }
footer strong { color: var(--white); }
footer small { color: var(--gray-600); }

.contact-link {
    color: var(--gray-400);
    font-weight: 500;
    transition: color .2s;
}
.contact-link:hover { color: var(--accent); }

/* --- Blog --- */
.blog-content {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    border: 1px solid var(--gray-200);
}
.blog-content h2 {
    color: var(--gray-900);
    margin-top: 2.5rem;
    font-size: 1.5rem;
}
.blog-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.25rem 0;
}
.clickable-span {
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    transition: color .15s;
}
.clickable-span:hover { color: var(--accent-hover); }

/* --- Scroll Reveal --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s cubic-bezier(.4, 0, .2, 1), transform .6s cubic-bezier(.4, 0, .2, 1);
}
.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    #mainNav .navbar-collapse {
        background: var(--white);
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        box-shadow: var(--shadow-xl);
        padding: .5rem;
        margin-top: .5rem;
    }
    #mainNav .navbar-collapse .nav-link {
        padding: .5rem .75rem;
    }
    #mainNav .dropdown-menu {
        display: none;
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 0 0 1.5rem !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        animation: none !important;
    }
    #mainNav .dropdown-menu.show {
        display: block !important;
    }

    header.masthead { padding: 8rem 0 4rem; }
    header.masthead h1 { font-size: 2rem; }
    header.masthead-smaller h1 { font-size: 1.5rem; }

    .top-products h2 { font-size: 1.5rem; }

    #chatbox-container { max-width: calc(100% - 48px); }
}

@media (max-width: 575.98px) {
    header.masthead::before,
    header.masthead-smaller::before {
        background-image: url('https://dymovody.sk/assets/img/bg-masthead-mobile-min.jpg');
    }

    header.masthead h1 { font-size: 1.75rem; }

    .product .card-img-top {
        max-height: 160px;
        padding: 1rem 1rem .5rem;
    }

    #productsContainer {
        padding: 1.25rem 1rem;
        border-radius: 16px;
    }

    .top-products {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

@media (min-width: 992px) {
    header.masthead {
        min-height: 38rem;
        padding: 12rem 0 8rem;
    }
    header.masthead h1 { font-size: 3.5rem; }
}
