@import "variables.css";

html,
body {
    margin: 0px;
    padding: 0px;
    border: 0px;
    font: var(--body-font);
    color: var(--body-color);
    line-height: var(--body-line-height);
    overflow-x: hidden;
    /* Prevent horizontal scroll globally */
    width: 100%;
}

* {
    box-sizing: border-box;
}

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

#bg_image {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
}

#bg_fading {
    position: fixed;
    top: -5px;
    left: -5px;
    height: 100vh;
    width: 101%;
    background: url(https://turekpianos.cz/images/fading000.png) repeat-x top;
    z-index: -1;
    filter: alpha(opacity=80);
    opacity: 0.9;
    pointer-events: none;
    /* Let clicks pass through */
}


/* Page Wrapper */
#page {
    color: #fff;
    max-width: 810px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    background: #393939 url(https://turekpianos.cz/images/vLine.png) repeat-x;
    /* Added content bg */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    /* Added shadow for page feel */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: bold;
    color: var(--header-color);
    line-height: var(--header-line-height);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

banner {
    width: 100%;
    box-sizing: content-box;
}

.banner-content {
    background-image: url(https://turekpianos.cz/images/banner_left.png), url(https://turekpianos.cz/images/banner_right.png);
    background-position: left top, right top;
    background-repeat: no-repeat;
    background-size: 170px, 170px;
    overflow: hidden;
    /* Fix banner text overflow */
}

.animacia,
.animacia a,
.animacia a:hover,
.animacia a:visited {
    position: relative;
    top: 0;
    height: 100px;
    max-width: 100%;
    color: white;
    text-decoration: none;
    text-align: center;
    font-size: var(--banner-font-size);
    font-weight: bold;
    display: grid;
    place-items: center;
}

.animacia p {
    padding: 20px;
    font-size: var(--banner-font-size);
    text-align: center;
    vertical-align: middle;
    border-top: 0;
    margin-top: 0;
    height: 100px;
    white-space: pre-wrap;
    display: none;
}

.animacia-item {
    display: none;
}

.animacia-item:nth-child(1) {
    display: block;
}

/* Navbar Styling */
.navbar {
    min-height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#nav>li.button {
    background: var(--header-color) url(http://turekpianos.cz/images/bg_button.png);
}

logo {
    padding: 5px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    display: none;
    background-image: url(https://turekpianos.cz/images/logo_plain.png);
    /* Hidden by default, shown on mobile if needed or if user wants a brand */
}

/* Mobile Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.4s;
}

/* Desktop Menu */
#nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

#nav>li.button {
    position: relative;
    /* background image moved to header.php to use IMG_SRC */
    margin: 1px;
    height: 40px;
    min-width: 90px;
    display: grid;
    place-items: center;
}

#nav>li>a {
    display: block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
    font-size: var(--navbar-font-size);

}

#nav>li:hover {
    /* background-color removed for desktop button per user request */
    background: #393939 url(https://turekpianos.cz/images/bg_button_hover.png) repeat-x;
}

/* Home Icon Styling */
.home-icon {
    height: 20px;
    vertical-align: middle;
    /* Removed background-image per user request to use <img> tag instead */
}

/* Desktop Hover Effect */
#nav>li.button:hover {
    filter: brightness(1.2);
    /* brightens the red gradient */
    cursor: pointer;
}

/* Subnav (Dropdown) */
.subnav {
    display: none;
    position: absolute;
    background-color: #444;
    min-width: 200px;
    list-style: none;
    padding: 0;
    top: 100%;
    left: 0;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

#nav>li:hover .subnav {
    display: block;
}

.subnav li a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.subnav li a:hover {
    background-color: #555;
}

/* Helper for arrows since images are missing */
.has-subnav::after {
    content: " ▼";
    font-size: 10px;
    margin-left: 5px;
}

/* Mobile Overlay Menu */
.overlay {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.95);
    overflow-x: hidden;
    transition: 0.5s;
    display: flex;
    flex-direction: column;
    padding-top: 60px;
}

.overlay-content {
    width: 100%;
    text-align: center;
}

.overlay a {
    padding: 15px;
    text-decoration: none;
    font-size: 24px;
    color: #818181;
    display: block;
    transition: 0.3s;
    margin: 1px;
    /* border-bottom: 2px solid #555; REMOVED per user request */
}

.overlay a:hover,
.accordion:hover {
    color: #f1f1f1;
    background-color: #333;
}

.overlay .mobile-sublink {
    font-size: 18px;
    color: #666;
    padding-top: 5px;
    padding-bottom: 5px;
    /* border-bottom: 1px solid #555; REMOVED per user request */
}

/* Accordion Styles */
.accordion {
    background-color: transparent;
    color: #818181;
    cursor: pointer;
    padding: 15px;
    width: 100%;
    border: none;
    text-align: center;
    outline: none;
    font-size: 24px;
    transition: 0.4s;
    display: block;
    margin: 1px;
}

.active {
    color: #f1f1f1;
    background-color: #333;
}

.panel {
    padding: 0;
    background-color: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}

.closebtn {
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 60px !important;
    cursor: pointer;
    color: white;
    display: block;
    z-index: 2001;
    border: none;
}

/* Footer */
footer {
    border-top: 1px dotted #ccc;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}



.content {
    padding: 20px;
    text-align: left;
    /* Changed from center to left for better reading */
}

/* Loading Logo */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s;
    pointer-events: none;
    /* Allows click through if it gets stuck/hidden but still DOM present */
}

.loading-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #333;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Cookies Notice */
#cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #606060;
    opacity: 0.9;
    color: var(--body-color);
    text-align: center;
    padding: 15px;
    z-index: 9000;
    display: none;
    /* Hidden by default, JS enables */
    box-sizing: border-box;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

#cookie-accept {
    margin-left: 20px;
    padding: 5px 15px;
    background-color: #f1f1f1;
    color: #333;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

/* --- HOME PAGE CONTENT STYLES --- */

.home-content h1,
.content h1 {
    text-align: center;
    /*margin-bottom: 30px;*/
}

.intro-text {
    text-align: left;
    /* margin-bottom: 40px;*/
}

/* Offers Grid */
.offers-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    /* Wraps on mobile */
}

.offers-grid>a>img {
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
}


.offer-card {
    flex: 1 1 250px;
    background: var(--offer-card-background-color);
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--offer-card-color);
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* Hint of the brand color maybe? kept neutral for now */
    border-color: #bbb;
}

.offer-card h2 {
    color: var(--header-color);
    /* Brand red for headers */
    margin-top: 0;
}

/* Brands Section */
.brands-section {
    margin-bottom: 30px;
    border-radius: 4px;
}

.brands-list,
.service-list,
.tp-list {
    padding: 10px;
    display: block;
    list-style-type: disc;
    margin-block-start: 1em;
    margin-block-end: 1em;
    padding-inline-start: 40px;
    unicode-bidi: isolate;
    background-color: var(--body-color);
    border-radius: 5px;
}

.brands-list li,
.service-list li,
.tp-list li {
    border-radius: 4px;
    color: #444;
}

/* About Section */
.about-section h2 {
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.info-block {
    margin-bottom: 20px;
}

.info-block h4 {
    margin: 0 0 5px 0;
}

.contact-info {
    text-align: center;
    font-size: 0.9em;
}

.contact-info a {
    color: var(--body-color);
    text-decoration: none;
}

label.error {
    color: var(--error-color);
}

#form-message {
    margin-top: 10px;
    color: var(--body-color);
}

#form-message span img {
    position: relative;
    top: 10px;
    width: 32px;
    height: 32px;
}

/* Responsive Breakpoint */
@media screen and (max-width: 900px) {
    logo a img {
        height: 60px;
    }

    #nav {
        display: none;
        /* Hide desktop menu */
    }

    .hamburger {
        display: flex;
        /* Show hamburger */
    }

    .navbar {
        justify-content: flex-end;
        padding: 0 10px;
        /* Align hamburger to right */
    }

    #background {
        display: none;
    }

    .welcome-section h1 {
        line-height: 1.5em;
    }

    /* Hide banner animation/text on mobile to prevent overflow */
    .animacia {
        display: none;
    }

    .banner-content {
        background-size: 120px, 120px;
        height: 85px;
    }

    .content {
        padding: 0px 15px;
    }

    /* Ensure horizontal lists are manageable */
    .brands-list,
    .service-list,
    .tp-list {
        padding-inline-start: 25px;
    }
}

/* Tablet / Smaller Desktop */
@media screen and (max-width: 600px) {

    /*    header {
        flex-direction: column;
        align-items: center;
    }
*/
    logo {
        padding: 10px 0;
    }

    .banner-content {
        background-size: 100px, 100px;
        height: 70px;
    }
}

/* Desktop 2-Column Layout */
@media screen and (min-width: 901px) {
    .main-layout {
        display: flex;
        gap: 30px;
        align-items: flex-start;
        width: 100%;
    }

    .offers-grid {
        flex: 0 0 300px;
        /* Rigid width */
        min-width: 300px;
        flex-direction: column;
        display: flex;
        /* Ensure it stays flex column */
        margin-bottom: 0;
        /* Remove bottom margin in this view */
    }

    .about-section {
        flex: 1;
        min-width: 0;
        /* Prevent flex item from overflowing container */
    }

    /* Adjust order/width of offers within the grid if needed */
    .offers-grid .offer-card {
        width: 100%;
    }
}

/* Service Page Styles */
.service-block {
    margin-bottom: 30px;
}

/* Service Gallery */
.service-gallery {
    margin-top: 30px;
}

.service-gallery h3 {
    margin-bottom: 15px;
}

.service-image-container {
    display: flex;
}

.service-image {
    flex: 1;
}

.service-image img {
    width: 100%;
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Reference Page Styles */
.reference-item {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    width: 100%;
    background-color: var(--body-color);
    border-radius: 5px;
    color: #444;
    padding: 10px;
}

.reference-item:has(.reference-text):has(.ps_album) {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 1.5rem;
}

.reference-item.center {
    text-align: center;
}

.reference-author {
    font-weight: bold;
    color: var(--header-color);
    margin-top: 10px;
    text-align: right;
}

.reference-author {
    grid-column: 1 / -1;
    /* span full width */
    grid-row: 3;
    justify-self: start;
    /* right edge of container */
    text-align: right;
}

.ps_album.stacktwo {
    opacity: 1;
    position: relative;
    /* margin-top: 155px;
    margin-left: -600px;
    */
}

/* Pianos Listing Styles */
.pianos-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.piano-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: dotted 1px var(--header-color);
    border-top: none;
    border-radius: 4px;
}

.piano-header {
    background: var(--header-color);
    padding: 8px 15px;
    background: linear-gradient(180deg, rgba(255, 0, 0, 1) 60%, rgba(255, 255, 255, 1) 100%);
}

.piano-header h2 {
    margin: 0;
    font-size: 1.1em;
    color: var(--body-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.piano-header h2 a {
    color: var(--body-color);
}

.piano-header h2 a:hover {
    text-decoration: none;
    color: var(--hover-color);
}

.piano-content {
    display: flex;
    padding: 15px;
    gap: 20px;
}

.piano-image {
    flex: 0 0 250px;
}

.piano-image img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.piano-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.piano-description {
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0 0 0 0;
}

.piano-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.more-info-btn {
    color: var(--header-color);
    text-decoration: none;
    font-weight: bold;

}

.more-info-btn:hover {
    text-decoration: underline;
}

.piano-price-box {
    min-width: 120px;
    text-align: center;
    background: var(--piano-label-background);
    width: 170px;
    height: 70px;
    display: grid;
    align-items: center;
    align-self: flex-end;
    background-size: 150px 60px;
}

.piano-price {
    font-weight: bold;
    color: #FF0000;
    font-size: 1.1em;
}

.video {
    margin: auto;
    text-align: center;
}

@media screen and (max-width: 768px) {
    .piano-content {
        flex-direction: column;
        gap: 15px;
    }

    .piano-image {
        flex: 1 1 auto;
        order: 1;
        max-width: 100%;
        margin: 0 auto;
    }

    .piano-info {
        order: 2;
    }

    .piano-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .piano-price-box {
        align-self: flex-end;
    }

    .reference-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .reference-text,
    .ps_album,
    .reference-author {
        grid-column: 1;
    }
}

/* Contact Page Styles */
.contact-details {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    /* Slight highlight */
    padding: 20px;
    border-radius: 4px;
}

.contact-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

/* Contact info top - full width on top */
.contact-section .contact-info-top {
    flex: 1 1 100%;
    width: 100%;
}

.contact-section .contact-info-top h2 {
    margin-top: 0;
    font-size: 1.4em;
}

/* Showroom images in one line on desktop */
.showroom-images {
    display: flex;
    flex-wrap: wrap;
}

.showroom-images .showroom-image {
    flex: 1 1 150px;
}

.showroom-images .showroom-image img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Contact details - left column */
.contact-section .contact-details {
    flex: 1 1 280px;
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 4px;
}

.contact-section .contact-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dotted #555;
}

.contact-section .contact-label {
    font-weight: bold;
    min-width: 80px;
    color: var(--header-color);
}

.contact-section .contact-value {
    color: var(--body-color);
    text-decoration: none;
}

.contact-section .contact-value:hover {
    text-decoration: underline;
}

/* Form section - right column */
.contact-section .contact-form-section {
    flex: 1 1 350px;
    min-width: 280px;
}

@media screen and (max-width: 768px) {
    .contact-section {
        flex-direction: column;
    }

    .contact-section .contact-item {
        flex-direction: column;
        gap: 5px;
    }

    .contact-section .contact-details,
    .contact-section .contact-form-section {
        flex: 1 1 100%;
        padding: 15px;
    }

    .service-image-container {
        flex-direction: column;
    }

    .showroom-images {
        flex-direction: column;
    }

    .showroom-images .showroom-image {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-section .contact-label.hidden {
        display: none;
    }

    .back-link {
        position: relative;
        top: 0px;
    }
}

.showroom-image img {
    width: 100%;
    /*max-width: 400px;*/
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Contact Form Section */
.contact-form-section {
    flex: 1 1 350px;
    min-width: 280px;
}

.contact-form-section fieldset {
    border: 1px solid #555;
    border-radius: 4px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
}

.contact-form-section legend {
    color: var(--header-color);
    font-weight: bold;
    font-size: 1.2em;
    padding: 0 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #ccc;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2a2a2a;
    color: var(--body-color);
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--header-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Captcha */
.captcha-group .captcha-wrapper {
    margin-bottom: 10px;
}

.captcha-group img {
    display: block;
    margin-bottom: 5px;
    border-radius: 4px;
}

.captcha-group a {
    color: var(--hover-color);
    font-size: 0.9em;
    text-decoration: none;
}

.captcha-group a:hover {
    color: var(--header-color);
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    background: var(--header-color);
    color: var(--body-color);
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: filter 0.3s, transform 0.2s;
}

.submit-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

#form-message {
    border-radius: 4px;
    display: none;
}

#form-message.success {
    display: block;
    background: #2e7d32;
    color: var(--body-color);
}

#form-message.error {
    display: block;
    background: #c62828;
    color: #fff;
}

/* Detail View Styles */
.piano-detail {
    margin-top: 20px;
}

.piano-detail h1 {
    font-size: 1.8em;
    /*border-bottom: 2px solid var(--header-color);*/
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.piano-detail-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-section {
    flex: 1 1 500px;
    /* Large gallery */
}

.main-image-container img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 15px;
    border: 3px solid;
}

.thumbnails-container {

    display: flex;
    justify-content: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    background: grey;
    height: 80px;
    position: relative;
    padding: 5px;
    border: solid 3px;
}

.gallery-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    border: 1px solid #555;
}

.gallery-thumb:hover {
    opacity: 1;
}

.info-section {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.piano-price-detail {
    font-size: 1.5em;
    color: var(--header-color);
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    text-align: center;
    border-radius: 4px;
}

.piano-description-detail div {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
    color: #ddd;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.back-link {
    position: relative;
    top: -55px;
    width: 300px;
}

.back-link .button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--header-color) var(--button-background);
    color: var(--body-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    height: 37px;
}

.back-link .button:hover {
    background: #555;
}

@media screen and (max-width: 800px) {
    .piano-detail-container {
        flex-direction: column;
    }

    .gallery-section,
    .info-section {
        flex: 1 1 100%;
    }
}

/* Video Container for Responsive 16:9 Aspect Ratio */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-bottom: 20px;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Footer Contact Icons */
.contact-info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.contact-info i {
    margin-right: 0px;
    color: var(--header-color);
    vertical-align: middle;
}

.separator {
    margin: 0 5px;
    color: #888;
}

@media screen and (max-width: 600px) {
    .contact-info-row {
        flex-direction: column;
        gap: 5px;
    }

    .separator {
        display: none;
    }
}