/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --responsive-space: clamp(10px, 2vw, 20px);
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #efefef;
}

@font-face {
    font-family: 'Kalam';
    src: url('fonts/kalam-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Kalam';
    src: url('fonts/kalam-bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

#about .tile p:not(:last-child) {
    margin-bottom: 1em;
}

#about div p:last-child {
    justify-self: flex-end;
    font-weight: bold;
    margin-right: 10%;
    font-size: 1.5em;
}

h1 {
    text-align: center;
    width: 100% !important;
    margin-bottom: var(--responsive-space);
    color: black !important;
}

h1, h2 {
    font-size: clamp(24px, 4vw, 30px);
}

h1, h2, h3 {
    font-family: 'Kalam', sans-serif;
    font-weight: 600;
    line-height: 1.15;
    margin-top: 0.2em;
    padding-right: 0.5ch;
    background: linear-gradient(130deg, #132d5c, #007bff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    width: fit-content;
}

section > .section-text {
    flex: 0 0 100%;
    padding-left: var(--responsive-space);
}

.section-text p:not(:first-child) {
    margin-top: 1em;
}

/* Container */
.container {
    max-width: 960px; /* Reduced from 1200px to 960px for a smaller, consistent width */
    margin: 0 auto;
    padding: 0 var(--responsive-space);
}

header + .container {
    margin-top: var(--responsive-space); /* Add this line */
}

/* Header */
header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: var(--responsive-space);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s;
}

header .container {
    width: 100%;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--responsive-space) / 2);
}

header.scrolled {
    padding: 10px var(--responsive-space);
}

.logo {
    max-height: 60px;
    transition: max-height 0.3s;
    display: block;
    margin: 0;
}

header.scrolled .logo {
    max-height: 40px;
}

.logo-container {
    display: flex;
}

.menu {
    font-family: 'Kalam', sans-serif;
    list-style: none;
    display: flex;
    gap: var(--responsive-space);
    justify-content: flex-end;
    font-size: 1.5em;
}

.menu li {
    display: inline;
}

.menu li a {
    font-size: clamp(20px, 4vw, 24px);
}

.menu a, footer .social-links a {
    font-weight: bold;
}

a {
    display: inline-block;
    position: relative;
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s ease-in-out;
}

header a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    right: 0; /* Change from left to right */
    background-color: #132d5c;
    transition: width 0.3s ease-in-out;
    transform-origin: right;
}

a:not(p > a, :has(img)):hover::after {
    width: 100%;
    left: 0;
    right: auto;
    transform-origin: left;
}

a:hover {
    color: #132d5c;
}

.quote {
    font-family: 'Kalam', sans-serif;
    font-size: 1.2em;
}

/* Sections */
section {
    display: flex;
    gap: var(--responsive-space);
    flex-wrap: wrap;
    padding: var(--responsive-space);
    /* padding-bottom: 30px; */
    background-color: #fff;
    margin-bottom: var(--responsive-space);
    border-radius: 8px;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
}

/* @property --tile-gradient {
    syntax: '<color>';
    initial-value: #132d5c;
    inherits: false;
} */

.tile {
    /* background: linear-gradient(113deg, #efefef80 75%, var(--tile-gradient) 360%); */
    background: #ebf1fb;
    padding: var(--responsive-space);
    border-radius: 8px;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
    transition: --tile-gradient 0.2s;
    flex: 1;
}

/* .tile:hover {
    --tile-gradient: #007bff;
} */

/* Hidden Class */
.hidden {
    display: none !important;
}

.text-content {
    flex: 2 1 500px;
}

.instagram-widget {
    flex: 1;
    padding: 10px;
    min-width: 300px;
}

.gallery:has(> div:nth-child(1):only-child) {
    max-width: fit-content;
}

.gallery {
    column-width: 100px;
    column-count: auto;
    column-gap: 10px;
    flex: 1;
}

.photo {
    break-inside: avoid;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    /* width: clamp(100px, 13vw, 130px); */
    max-width: unset;
    min-width: 80px;
}

.product .photo {
    max-width: 112.5px;
}

.photo img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.photo:hover img {
    transform: scale(1.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    grid-template-areas:
        "photo"
        "caption"
        "controls";
    grid-template-columns: 1fr;
    grid-template-rows: 1fr max-content max-content;
    align-items: center;
    justify-items: center;
    gap: var(--responsive-space);
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: calc(2 * var(--responsive-space));
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

button, select, a, .gallery {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: #007bff;
    color: white;
}

.modal-content {
    grid-area: photo;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
    contain: size;
}

.modal .caption {
    grid-area: caption;
}

#modal-caption {
    text-align: center;
    color: #fff;
    font-size: 1.2em;
}

#modal-link {
    text-align: center;
}

#modal-link:hover {
    color: #fff;
}

.modal .modal-controls {
    grid-area: controls;
    display: flex;
    gap: var(--responsive-space);
}

/* Modal Navigation Buttons */
.modal-nav {
    grid-area: controls;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid white;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    background: none;
    transition: background 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.modal-nav img {
    filter: invert(1);
    margin-top: 1px;
}

.modal-nav:hover {
    background: rgba(0, 123, 255, 0.6);
}

.contact-details {
    flex: 1 2 300px;
}

.map-snippet {
    padding: 0;
    height: 200px;
    overflow: hidden;
    flex: 1 1 300px;
}

.map-snippet iframe {
    border: none;
}

/* Products Section */
#products {
    margin-top: var(--responsive-space);
}

.product.unavailable {
    -webkit-filter: grayscale(1);
    filter: grayscale(1);
}

.product.unavailable .product-name h3:after {
    content: " - nedostupné";
}

.product.unavailable .add-to-basket {
    cursor: not-allowed;
}

/* Disabled selects inside unavailable products: keep gray look and default cursor */
.product.unavailable select:disabled,
.product.unavailable select,
.product.unavailable .select-container select:disabled {
    cursor: default !important;
}

.product:not(:last-child) {
    width: 100%;
    /* margin-bottom: var(--responsive-space); */
    border-bottom: 1px solid #ddd;
    padding-bottom: var(--responsive-space);
}

.product .tile {
    display: flex;
    gap: var(--responsive-space);
    flex-wrap: wrap;
    justify-content: space-between;
}

.product .tile .text {
    display: flex;
    gap: var(--responsive-space);
    flex-direction: column;
    flex: 1 1 350px;
}

.product .tile .product-name, .basket-empty, .tile-title {
    font-family: 'Kalam', sans-serif;
    font-size: 20px;
    flex: 1 1 100%;
    line-height: 1;
}

.product-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--responsive-space);
}

.product-details .key {
    font-family: 'Kalam', sans-serif;
    font-size: 17px;
}

.product-details .value, ul {
    list-style-position: outside;
    list-style-type: '– ';
    padding-left: 15px;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .select-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-basis: 100%;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .select-container label {
    flex: 0 0 fit-content;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .select-container select {
    flex: 1 1 fit-content;
}

/* Keep disabled selects looking normal for the special bundle */
.product[data-id="darkove-baleni-bezlepkove"] select:disabled {
    opacity: 1; /* cancel default dimming */
    color: inherit;
    -webkit-text-fill-color: inherit; /* Safari */
    background-color: #fff; /* match enabled background */
    cursor: default;
    filter: none;
}

.select-container:has(select:disabled)::after {
    content: '';
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .add-to-basket {
    flex-grow: 1;
    flex-basis: max-content;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants {
    gap: 0;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .select-container {
    margin-bottom: 10px;
}

.product[data-id="darkove-baleni-bezlepkove"] .tile .variants .spacer {
    flex-grow: 100;
    flex-basis: 70%;
    height: 0;
}

.variants {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: fit-content
}

.add-to-basket {
    background-color: #007bff;
    color: white;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 16px;
    flex-grow: 1;
    transition: background-color 0.3s;
}

/* Ensure textarea uses site font instead of browser monospace default */
textarea#order-note,
textarea#order-note:focus {
    font-family: Arial, sans-serif;
}

.product:not(.unavailable) .add-to-basket:hover {
    background-color: #0056b3;
}

/* Basket Section */
#basket .tile {
    flex-basis: 100%;
}

#basket .basket-empty {
    text-align: center;
}

#basket-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: var(--responsive-space);
    margin-bottom: var(--responsive-space);
}

.basket-item {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f9f9f9;
}

.basket-item .product-name {
    margin: 0;
    flex: 1 1 300px;
    align-self: center;
}

.basket-item .actions {
    display: flex;
    gap: 10px;
    align-items: center;
    align-self: start;
}

.basket-item .quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.basket-item .quantity-btn {
    width: 30px;
    height: 30px;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.basket-item .quantity-btn:hover {
    background-color: #ddd;
}

.basket-item .quantity-input {
    width: 40px;
    height: 30px;
    padding: 5px;
    text-align: center;
    font-size: 16px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    background-color: #fff;
}

.basket-item .product-price {
    font-weight: bold;
    flex-shrink: 0;
}

.basket-item .remove-btn {
    font-size: 18px;
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    transition: color 0.2s;
}

.basket-item .remove-btn:hover {
    color: red;
}

/* removed empty #basket-summary ruleset */

/* Order Form */
#order-form {
    /* margin-top: var(--responsive-space); */
    /* padding: var(--responsive-space);
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1); */
}

#order-form > div:first-child {
    padding-top: 0;
    margin-top: 0;
}

#order-form > div {
    padding-top: calc(var(--responsive-space) / 2);
    margin-top: var(--responsive-space);
    /* border-top: 1px solid red; */
}

#order-form > div h3 {
    margin-bottom: calc(var(--responsive-space) / 2);
}

#order-form .form-group {
    display: flex;
    margin-bottom: calc(var(--responsive-space) / 2);
    flex-wrap: wrap;
}

.form-group:has(input[type=checkbox]:checked) + div:is(.order-company-info, .order-invoice-info),
.form-group:has(input[type=checkbox]#order-cash-on-delivery) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#order-form label {
    display: block;
    flex-basis: 100%;
    font-weight: bold;
    /* margin-bottom: 5px; */
    color: #333;
}

#order-form input {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s;
}

#order-form input:focus {
    border-color: #007bff;
    outline: none;
}

#order-form input:read-only {
    border-color: #ccc;
    cursor: default;
}

#order-form button {
    margin-top: 10px;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s;
}

#order-form button:hover {
    background-color: #0056b3;
}

/* Form toggle sections */
.order-company-info,
.order-invoice-info {
    display: none;
    /* margin-top: 15px;
    padding-top: 15px; */
    border-top: 1px solid #eee;
}

/* Style the checkboxes */
#order-form input[type="checkbox"] {
    width: 2.5em;
    aspect-ratio: 1 / 1;
    /* margin-right: 10px; */
    border-radius: 5px;
    appearance: none;
    background: white;
    position: relative;
}

#order-form input[type="checkbox"]:disabled {
    background: grey;
}

#order-form input[type="checkbox"]:checked {
    background: #007bff;
}

#order-form input[type="checkbox"]:checked:after {
    position: absolute;
    content: '\2713';
    left: 50%;
    top: 50%;
    transform: translate(-50%, -52%);
    color: white;
    font-size: 2em;
}

/* Ensure select elements match text inputs */
#order-form select {
    width: 100%;
    padding: 10px 6px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: border-color 0.3s;
    background-color: white;
}

#order-form select:focus {
    border-color: #007bff;
    outline: none;
}

/* For browsers that don't support :has() */
#company-purchase,
#invoice-different-address {
    width: auto;
    margin-right: 10px;
}

.order-delivery-type .form-group {
    gap: calc(var(--responsive-space) / 2);
}

.order-delivery-type #delivery-method {
    width: unset;
    flex-grow: 1;
}

.order-delivery-type #select-delivery-point {
    margin-top: 0;
}

/* Footer */
footer {
    display: flex;
    background: #ddd;
    padding: var(--responsive-space);
    box-shadow: 0px 3px 3px inset rgba(0, 0, 0, 0.1);
    border-radius: 0; /* Match header's straight edges */
    font-size: 85%;
    line-height: 1.25;
}

footer .footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer .footer-columns {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

footer .footer-columns {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

footer .footer-left,
footer .footer-right {
    /* flex: 1; */
    padding: 0 10px;
}

footer .social-links {
    text-align: center;
    margin: calc(var(--responsive-space) / 2);
}

footer .social-links a {
    margin: 0 10px;
}

footer .copyright {
    text-align: center;
}

footer .copyright p {
    margin-top: 0.25em;
}

/* Follow Us Section */
.follow-us-section {
    justify-content: center;
}

.follow-us-section h2 {
    margin: 0 auto;
}

/* .follow-us-section h2 {
    margin: 0 auto;
    text-align: center;
} */

.follow-us-section .social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.follow-us-section .social-icons img {
    width: 60px;
    height: 60px;
    transition: transform 0.3s;
}

.follow-us-section .social-icons img:hover {
    transform: scale(1.1);
}

#variant {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    appearance: none;
    background-color: #fff;
    cursor: pointer;
}

.select-container {
    position: relative;
    display: inline-block;
    flex-grow: 1;    
}

.select-container select {
    width: 100%;
    padding: 10px;
    padding-right: 30px; /* Space for the arrow */
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    appearance: none;
    background-color: #fff;
    cursor: pointer;
}

.select-container::after {
    content: '▼'; /* ASCII arrow character */
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%) rotate(0deg); /* Initialize rotation */
    pointer-events: none;
    font-size: 0.8em;
    color: #333;
    transition: transform 0.3s; /* Smooth transition */
}

.select-container:focus-within::after {
    transform: translateY(-50%) rotate(180deg); /* Rotate arrow when focused */
}

/* Unified carrier map overlay and container styles */
.carrier-map-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrier-map-container {
    background: #fff;
    width: 85vw;
    max-width: 1600px;
    height: 85vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
    display: block;
}

#ppl-parcelshop-map, .ppl-parcelshop-map-theme {
    height: 85vh !important;
}

.delivery-point-details {
    flex-basis: 100%;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #333;
    word-break: break-word;
    white-space: pre-line;
    box-sizing: border-box;
    font-style: italic;
}
.delivery-point-details:empty::before {
    content: attr(data-placeholder);
    color: #F4320B;
}