/* =========================== Karty produktów =========================== */

#page-callendars .layout {
    padding-block: var(--gap-L);
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-S);
}

/* ======= Karta ======= */

.product-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;

    min-width: 0;

    padding: 6px;

    
    border-radius: var(--radius);

    overflow: hidden;

    text-decoration: none;
    color: inherit;

    position: relative;

    transition: .2s ease;
}

/* ======= Zdjęcie ======= */

.product-card-image {
    position: relative;

    flex: 0 0 30%;
    width: 30%;
    aspect-ratio: 1 / 1;

    align-self: flex-start;

    background: var(--color-light);
    border-radius: 18px;

    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    border-radius: 18px;
}

.product-card-image-hover {
    position: absolute;
    inset: 0;

    opacity: 0;

    transition: opacity 0.3s ease;

    border-radius: 18px;
}

/* ======= Zawartość ======= */

.product-card-body {
    flex: 1;
    min-width: 0;

    z-index: 10;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding-left: var(--gap-S);
}

/* ======= Kolory oprawy ======= */

.product-card-colors {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-start;

    gap: 5px;

    margin-bottom: 10px;
}

.product-card-color {
    display: block;

    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    border-radius: 4px;

    border: 2px solid var(--color-white);
    outline: 1px solid var(--border);
}

/* ======= Tytuł ======= */

.product-card-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 8px;
}

.product-card-header > div {
    min-width: 100%;
}

.product-card-title {
    display: block;

    font-size: var(--font-size);
    line-height: 1.05;

    font-weight: var(--font-bold);

    padding-right: 0;
}

.product-card-header i {
    flex: 0 0 auto;

    margin-top: 2px;

    transition: transform 0.3s ease;
}

/* ======= Opis ======= */

.product-card-subtitle {
    margin: 0;
    padding-top: 10px;
    font-size: var(--font-size-S);
    line-height: 1.45;
}

.product-card-category {
    margin: 0;
    font-size: var(--font-size);
}

/* ======= Badge ======= */

.product-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: var(--font-size-S);
    line-height: 1.2;
    font-weight: var(--font-semibold);
    color: var(--color-white);
    background: var(--color-red);
    border-radius: var(--radius);
}

/* ======= Hover ======= */

@media (hover: hover) and (pointer: fine) {

    .product-card:hover .product-card-image-hover {
        opacity: 1;
    }

}

/* ======= Tablet/Desktop ======= */

@media (min-width: 768px) {

    .product-card-body i {
        transition: transform 0.3s ease;
    }

    .product-card:hover .product-card-body i {
        transform: translateX(5px);
    }
    
    .product-card:hover {
        box-shadow: var(--shadow);
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--gap-M);
    }

    .product-card {
        flex-direction: column;
        padding: calc(var(--gap-S) / 2);
        border: 1px solid var(--border);
    }

    .product-card-image {
        width: 100%;
        flex: 0 0 auto;

        aspect-ratio: 1 / 1;

        border-radius: 20px;
    }

    .product-card-image img {
        border-radius: 20px;
    }

    .product-card-body {
        padding: var(--gap-M) var(--gap-S);
    }

    .product-card-colors {
        justify-content: center;

        margin-bottom: 20px;
    }

    .product-card-color {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }

    .product-card-title {
        font-size: var(--font-size-M);
        line-height: 100%;

        padding-right: 6px;
    }

    .product-card-subtitle {
        font-size: var(--font-size);
        padding-top: var(--gap-S);
    }

    .product-card-badge {
        top: 12px;
        left: 12px;
        padding: 4px 9px;
    }

}

@media (min-width: 1200px) {

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

}

/* =========================== Realizacje =========================== */

#page-realizations .layout {
     padding-top: var(--gap-L);
}

.realization-card:focus,
.realization-card:focus-visible {
    outline: none;
}

.realization-more .realization-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .50);
    color: #fff;
    font-size: var(--font-size-XXL);
    font-weight: var(--font-bold);
    transition: background .2s ease;
    z-index: 10;
}

.realization-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform .2s ease;
}

.realization-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(var(--color-light-rgb), .50);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
}

.realization-card:hover::after {
    opacity: 1;
}

.realization-card img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter .2s ease;
}

.realizations-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap-S);
}

.realizations-gallery .realization-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.realizations-gallery .realization-card {
    flex: 0 0 calc(50% - (var(--gap-S) / 2));
    aspect-ratio: 1 / 1;
}

@media (min-width: 992px) {

    .realizations-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--gap-M);
    }

}

/* =========================== Pomoc =========================== */

#page-help .layout {
    padding-block: var(--gap-L);
}

/* =========================== Kontakt =========================== */

#page-contact {
    padding-top: var(--gap-L);
    margin-bottom: 0px;
}

#contact-form {
    margin-top: var(--gap-S);
}

.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap-M);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--gap-S);
}

.form-field-full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: var(--font-semibold);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: var(--gap-S);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--color-white);
    color: inherit;
    font: inherit;
}

.form-field textarea {
    min-height: 170px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--color-dark);
}

.form-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9L12 15L18 9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.form-consent {
    margin-top: 1.5rem;
}

.form-consent label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    cursor: pointer;

    font-size: var(--font-size);
    line-height: 1.5;
}

.form-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    cursor: pointer;
}

.form-consent a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-consent a:hover {
    color: var(--color-primary);
}
    
.contact-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
}

.contact-form-actions button {
    padding: 0.9rem 1.6rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--color-secondary);
    color: #fff;
    font: inherit;
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.contact-form-actions button:hover {
    opacity: 0.85;
}

.contact-form-actions button:active {
    transform: translateY(1px);
}

.contact-form-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contact-form-message {
    display: none;

    margin-bottom: var(--gap-M);
    font-size: var(--font-size);
    line-height: 1.5;
}

.contact-form-message.is-success,
.contact-form-message.is-error {
    display: block;
}

.contact-form-message.is-success {
    padding: 1rem 1.25rem;

    border-radius: 0.4rem;

    background: #eef7ee;
    color: #245b2a;
}

.contact-form-message.is-error {
    padding: 1rem 1.25rem;

    border-radius: 0.4rem;

    background: #f9eeee;
    color: var(--color-red);
}

.form-honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


@media (max-width: 769px) {

    .contact-form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-field-full {
        grid-column: auto;
    }

    #contact-form {
        margin-top: 2rem;
    }

    .contact-form-actions {
        justify-content: stretch;
    }

    .contact-form-actions button {
        width: 100%;
    }

}

/* =========================== Regulamin =========================== */

#page-regulations .layout {
    padding-block: var(--gap-L);
}

.regulations-layout {
    display: block;
}

.regulations-sidebar {
    margin-top: var(--gap-M);
    margin-bottom: var(--gap-M);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

.regulations-sidebar-inner {
    display: grid;
    gap: 0;
}

.regulations-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 0;

    font-weight: 600;
    cursor: pointer;
}

.regulations-sidebar-header i {
    display: block;

    transition: transform .2s ease;
}

#regulations-nav {
    display: none;
    gap: 4px;
    padding-bottom: 12px;
}

.regulations-sidebar.active #regulations-nav {
    display: grid;
}

.regulations-sidebar.active
.regulations-sidebar-header i {
    transform: rotate(180deg);
}

#regulations-nav a {
    position: relative;

    padding: 8px 0;

    color: inherit;
    text-decoration: none;

    opacity: .55;

    transition:
        opacity .2s ease,
        padding-left .2s ease;
}

#regulations-nav a:hover {
    opacity: 1;
}

#regulations-nav a.active {
    padding-left: 12px;
    opacity: 1;
}

#regulations-nav a.active::before {
    content: "";

    position: absolute;
    left: 0;
    top: 50%;

    width: 4px;
    height: 4px;

    border-radius: 50%;

    transform: translateY(-50%);

    background: currentColor;
}

.regulations-content {
    display: block;
}

.regulations-intro {
    max-width: 760px;
    margin-top: var(--gap-M);
}

.regulations-document {
    max-width: 760px;

    margin-top: 0;

    display: grid;
    gap: var(--gap-XL);
}

.regulations-document section {
    scroll-margin-top: 30px;
}

.regulations-document h2 {
    margin-bottom: var(--gap-M);
}

.regulations-document p {
    margin-bottom: var(--gap-S);
}

.regulations-document p:last-child {
    margin-bottom: 0;
}

@media (min-width: 769px) {

    .regulations-content {
        display: grid;

        grid-template-columns:
            240px
            minmax(0, 760px);

        column-gap: var(--gap-XL);

        align-items: start;
    }

    .regulations-content > .header-title,
    .regulations-content > .regulations-intro {
        grid-column: 2;
    }

    .regulations-sidebar {
        grid-column: 1;
        grid-row: 1 / span 3;

        position: sticky;
        top: 120px;
        border: 0;
        margin: 0;
    }

    .regulations-document {
        grid-column: 2;

        margin-top: var(--gap-XL);
    }

    .regulations-sidebar-header {
        padding: 0;
        cursor: default;
    }

    .regulations-sidebar-inner {
        gap: var(--gap-S);
    }
    
    .regulations-sidebar-header i {
        display: none;
    }

    #regulations-nav {
        display: grid;
        padding-bottom: 0;
    }

}

/* =========================== 404 =========================== */

#page-404 .layout {
    min-height: 60vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding-block: var(--gap-XL);
}

.page-404-content {
    width: 100%;
    max-width: 760px;

    text-align: center;
}

.page-404-number {
    margin-bottom: var(--gap-S);

    font-size: clamp(80px, 15vw, 180px);
    line-height: .8;
    font-weight: var(--font-bold);

    color: var(--color-primary);

    letter-spacing: -0.06em;
}

.page-404-content .header-title {
    justify-content: center;
}

.page-404-content .header-title p {
    text-align: center;
}

.page-404-content h1 {
    text-align: center;
}

.page-404-description {
    max-width: 560px;

    margin: var(--gap-M) auto 0;

    line-height: 1.6;
}

.page-404-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: var(--gap-L);

    padding: 0.9rem 1.6rem;

    border-radius: var(--radius);

    background: var(--color-secondary);
    color: var(--color-white);

    font-weight: var(--font-semibold);

    text-decoration: none;

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.page-404-button:hover {
    opacity: .85;
}
