:root {
    --bg: #faf7f3;
    --fg: #1f1f1f;
    --accent: #c53b3b;
    --accent-soft: #ffe6dc;
    --border-soft: #e2d7c8;
    --muted: #777;
    --radius-lg: 1.25rem;
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.06);
    --header-height: 80px;
    --max-width: 1200px;
    --footer-bg: #151515;
    --footer-fg: #f3f3f3;
}

/* GLOBAL RESET / BASE */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 247, 243, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1.5rem;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Logo */

.logo {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.logo span:first-child {
    color: var(--accent);
}

.logo img.logo-img {
    height: 45px;
    width: auto;
    display: block;
}

/* Icon buttons / login buttons */

.icon-button {
    border: none;
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.icon-button img.icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
}

.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
    background: var(--accent-soft);
}

.login-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #fff;
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.login-link:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.user-greeting {
    font-size: 0.85rem;
    color: var(--muted);
}

.logout-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.9rem;
}

/* Search form */

.search-form {
    position: relative;
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    animation: slideIn 0.25s ease forwards;
}

.search-form input {
    border: none;
    outline: none;
    font-size: 0.85rem;
    min-width: 160px;
}

.search-form button {
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
}

.search-form-visible {
    display: inline-flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* NAV / DROPDOWN */

.main-nav {
    position: sticky;
    top: var(--header-height);
    z-index: 90;
    background: rgba(250, 247, 243, 0.96);
    backdrop-filter: blur(10px);
}

.nav-line {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 0;
}

.nav-center {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.35rem 1.5rem;
    display: flex;
    justify-content: center;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    border: none;
    background: #fff;
    padding: 0.5rem 1.6rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dropdown-toggle::after {
    content: "▾";
    font-size: 0.8rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 260px;
    background: #fff;
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
    display: none;
}

.dropdown-visible {
    display: block;
}

.dropdown-item,
.dropdown-subitem {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 0.7rem;
    font-size: 0.88rem;
    cursor: pointer;
}

.dropdown-item:hover,
.dropdown-subitem:hover {
    background: var(--accent-soft);
}

.dropdown-group {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
}

.dropdown-group-title {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 0.25rem;
}

/* INTRO SECTION */

.intro-section {
    max-width: var(--max-width);
    margin: 2rem auto 1.5rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 2rem;
}

.intro-text h1 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    margin-bottom: 1rem;
}

.intro-text p {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: var(--muted);
    line-height: 1.6;
}

.intro-text ul {
    padding-left: 1.1rem;
    margin-top: 0.4rem;
    margin-bottom: 0.8rem;
}

.intro-text li {
    margin-bottom: 0.25rem;
    color: var(--muted);
}

.intro-graphics {
    display: grid;
    gap: 1rem;
}

.intro-image-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

.intro-image-card span {
    padding: 0.75rem 0.9rem 0.95rem;
    font-size: 0.85rem;
}

/* PRODUCT PAGES */

.product-page {
    max-width: var(--max-width);
    margin: 2rem auto 3rem;
    padding: 0 1.5rem;
}

.product-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-page-header h1 {
    margin: 0 0 0.3rem;
    font-size: 1.6rem;
}

.product-page-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Sorting form */

.product-sort-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.product-sort-form select {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: #fff;
}

/* Product grid */

.product-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.1rem;
    align-items: stretch;
}

/* 3 products per row on desktop list page */

.product-grid-page {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

/* Product card */

.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.14);
}

.product-image-wrapper {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 0.8rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info h3 {
    font-size: 0.95rem;
    margin: 0 0 0.3rem;
}

.product-price {
    margin: 0 0 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

/* Stock / waiting */

.product-stock {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.product-stock-out {
    color: var(--accent);
}

.product-waiting {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    color: var(--muted);
}

/* CTA button (also used elsewhere) */

.add-to-cart {
    margin-top: auto;
    align-self: flex-start;
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.12s ease, transform 0.12s ease;
}

.add-to-cart:hover {
    background: #a72f2f;
    transform: translateY(-1px);
}

/* PRODUCT DETAIL */

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 2rem;
}

.product-detail-image {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}

.product-detail-info h1 {
    margin-top: 0;
}

.product-detail-cart-form input {
    margin-right: 0.5rem;
}

/* CART TABLE / UTILS */

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.cart-table th,
.cart-table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 0.5rem 0.4rem;
    text-align: left;
}

.cart-table th {
    font-weight: 600;
}

.cart-table td form {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cart-table input[type="number"] {
    width: 60px;
}

.cart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.cart-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

/* generic links */

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.back-link:hover {
    text-decoration: underline;
}

.cart-remove-link {
    font-size: 0.8rem;
    color: var(--accent);
    cursor: pointer;
}

.cart-remove-link:hover {
    text-decoration: underline;
}

/* basket icon / qty controls */

.basket-button {
    position: relative;
}

.basket-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: var(--accent);
    border-radius: 999px;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border-soft);
}

.qty-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input {
    width: 40px;
    border: none;
    text-align: center;
    font-size: 0.9rem;
    outline: none;
}

/* disabled qty button */
.qty-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* "no more available" message */
.qty-warning {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--accent);
}

/* hide default spinner arrows in some browsers */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* standard + Firefox fallback */
.qty-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.qty-unit {
    font-size: 0.75rem;
    color: var(--muted);
}

/* CHECKOUT LAYOUT */

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr);
    gap: 2rem;
}

.checkout-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}

.checkout-box h2 {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.checkout-main form input,
.checkout-main form textarea,
.checkout-main form select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

.checkout-row {
    margin-bottom: 0.75rem;
}

.two-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.checkout-summary {
    position: sticky;
    top: calc(var(--header-height) + 16px);
    align-self: flex-start;
}

.checkout-summary .checkout-total {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin: 1rem 0 0.25rem;
}

.checkout-vat {
    font-size: 0.8rem;
    color: var(--muted);
}

.checkout-products {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.checkout-products li {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.checkout-hint {
    font-size: 0.8rem;
    color: var(--muted);
}

/* customer type "buttons" */

.customer-type-toggle {
    display: inline-flex;
    background: #fff;
    border-radius: 0.9rem;
    border: 1px solid var(--border-soft);
    overflow: hidden;
    margin-bottom: 1rem;
}

.customer-type-option {
    position: relative;
    cursor: pointer;
}

.customer-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.customer-type-option span {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.customer-type-option input:checked + span {
    background: #fdf2ff;
    color: #b3397c;
    font-weight: 600;
    box-shadow: 0 0 0 1px #b3397c;
}

/* =========================
   CHECKOUT: SHIPPING CARDS
   ========================= */

.ship-group-title {
    margin: 10px 0 6px;
    font-weight: 700;
}

.ship-card {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 14px;
    padding: 12px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    background: #fff;
    cursor: pointer;
}

.ship-card:hover {
    border-color: rgba(0, 0, 0, 0.28);
}

.ship-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ship-radio {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ship-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ship-name {
    font-weight: 700;
}

.ship-sub {
    font-size: 0.92rem;
    opacity: 0.8;
}

.ship-price {
    font-weight: 800;
    white-space: nowrap;
}

.ship-icon-svg {
    width: 36px;
    height: 36px;
    stroke: var(--fg);
    stroke-width: 1.8;
    fill: none;
    flex-shrink: 0;
}

.ship-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.ship-error {
    border: 2px solid #d40000;
    background: #fff5f5;
    color: #a40000;
    padding: 10px 12px;
    border-radius: 12px;
    display: none;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.ship-error a {
    color: #0b59ff;
    text-decoration: underline;
}

/* other toggles / checkboxes */
/* --- consents / checkboxes --- */
.checkbox-grid {
    display: grid;
    row-gap: 0.6rem;
}

.checkbox-row {
    display: grid;
    grid-template-columns: auto 1fr;  /* col 1 = checkbox, col 2 = text */
    column-gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.9rem;
}

.checkbox-row span {
    line-height: 1.4;
}


/* CLEAR CART BUTTON used in /koszyk/ */

.cart-clear-link {
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-soft);
    background: #fff;
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cart-clear-link:hover {
    background: var(--accent-soft);
}

/* MINI CART */

.mini-cart {
    position: fixed !important;
    top: calc(var(--header-height) + 10px) !important;
    right: 1.5rem !important;
    left: auto !important;
    width: 360px;
    max-width: calc(100% - 3rem);
    z-index: 9999;
    display: none;
}

.mini-cart-visible {
    display: block !important;
}

.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mini-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}

.mini-cart-name {
    font-weight: 600;
}

.mini-cart-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.mini-cart-price {
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
}

.mini-cart-footer {
    border-top: 1px solid var(--border-soft);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mini-cart-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
}

/* mini-cart box styling */

.mini-cart .checkout-box {
    border-radius: 1.5rem;
    background: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* mini-cart CTA */

.mini-cart .add-to-cart {
    width: 100%;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
    padding: 0.55rem 1.4rem;
    font-weight: 600;
}

/* FOOTER */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-fg);
    padding: 2.5rem 1.5rem 1.5rem;
    margin-top: 2rem;
}

.footer-columns {
    max-width: var(--max-width);
    margin: 0 auto 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1.5rem;
}

.footer-column h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column li {
    margin-bottom: 0.35rem;
}

.footer-column a {
    font-size: 0.88rem;
    color: var(--footer-fg);
    opacity: 0.85;
    transition: opacity 0.12s ease, text-decoration 0.12s ease;
}

.footer-column a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.75rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* SCROLL TOP BUTTON */

.scroll-top-button {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    border: none;
    background: var(--accent);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 150;
}

.scroll-top-button.scroll-top-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* RESPONSIVE BREAKPOINTS */

@media (max-width: 992px) {
    .product-grid-page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .product-grid-page {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 1rem;
    }

    .intro-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .header-center {
        order: -1;
        justify-content: flex-start;
    }

    .search-form {
        position: absolute;
        top: calc(var(--header-height) - 10px);
        left: 1rem;
    }
}

@media (max-width: 600px) {
    .mini-cart {
        right: 0.5rem !important;
        left: 0.5rem !important;
        width: auto !important;
    }
}
