/*== Items / Item Detail ==*/
html {
    overflow-x: clip;
}

body:has([data-items-page]) {
    overflow-x: clip;
    overflow-y: visible;
}

body:has([data-items-page]) main {
    overflow: visible;
    transform: none;
    contain: none;
}

body:has([data-items-page]) .items-page,
body:has([data-items-page]) .items-page > .container,
body:has([data-items-page]) .items-layout,
body:has([data-items-page]) .items-sidebar-column,
body:has([data-items-page]) .items-content {
    overflow: visible;
    transform: none;
    contain: none;
}


/*== Shared Containers ==*/
.items-page > .container,
.item-detail-page > .container,
.items-page-container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 12px;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.items-content,
.item-detail-main,
.item-detail-sidebar,
.item-detail-panel,
.item-detail-description-card,
.card-content {
    min-width: 0;
}

/*== Empty State ==*/
.empty-state {
    padding: 3rem;
    margin-top: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(17, 24, 39, 0.15);
    border-radius: 20px;
}

.empty-state h5,
.empty-state p {
    margin: 0;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/*== Items Hero ==*/
.items-page-hero {
    position: relative;
    padding: 80px 0 70px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(229, 57, 53, 0.65)),
    url("https://images.unsplash.com/photo-1511578314322-379afb476865?q=80&w=1600&auto=format&fit=crop") center / cover no-repeat;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.items-page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255, 122, 24, 0.25), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(229, 57, 53, 0.25), transparent 50%);
}

.items-page-hero-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1140px;
    margin-inline: auto;
    padding-inline: 12px;
}

.items-page-hero-content {
    max-width: 900px;
    margin-inline: auto;
    text-align: center;
}

.items-page-hero-title {
    margin: 0;
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    line-height: 3rem;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, #ffe5e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.items-page-hero-text {
    display: inline-block;
    max-width: 40rem;
    margin: 0;
    padding: 0.3125rem 0.75rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.5;
}

/*== Main Layout ==*/
.items-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 50px;
    align-items: start;
    width: 100%;
    margin-inline: auto;
}

/*== Items Sidebar ==*/
.items-sidebar-column {
    position: relative;
    min-width: 0;
    align-self: stretch;
}

.items-sidebar {
    position: sticky;
    top: 88px;
    z-index: 20;
    width: 100%;
    height: fit-content;
    max-height: calc(100vh - 110px);
}

.items-sidebar-inner {
    width: 100%;
    max-height: calc(100vh - 100px);
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.06);
}

.items-sidebar-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 122, 24, 0.25);
    border-radius: 14px;
    background: rgba(255, 122, 24, 0.08);
    color: #ff6a00;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.items-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.items-sidebar-link {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: #f8fafc;
    color: #1f2937;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    box-shadow: none;
    transition: border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
    min-height: 46px;
    padding: 10px 12px;
    font-size: 0.85rem;
    border-radius: 13px;
}

.items-sidebar-link span {
    display: block;
    width: 100%;
    min-width: 0;
}

.items-sidebar-link::before,
.items-sidebar-link::after {
    display: none;
}

.items-sidebar-link:hover {
    transform: translateX(2px);
    border-color: rgba(255, 122, 24, 0.25);
    background: #fff7f1;
    color: #ff6a00;
    box-shadow: 0 8px 18px rgba(255, 122, 24, 0.08);
}

.items-sidebar-link.active {
    border-color: transparent;
    background: linear-gradient(135deg, #ff8a1c, #ff5c0a);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(255, 94, 10, 0.22),
    0 0 20px rgba(255, 94, 10, 0.10);
}

/*== Sidebar Scrollbar - Light ==*/
.items-sidebar-inner {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

.items-sidebar-inner::-webkit-scrollbar {
    width: 10px;
}

.items-sidebar-inner::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 999px;
}

.items-sidebar-inner::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
    border: 2px solid #f8fafc;
}

.items-sidebar-inner::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/*== Category Blocks ==*/
.items-category {
    margin-bottom: 170px;
    scroll-margin-top: 120px;
}

.items-category-card,
.items-product-grid {
    width: min(100%, 1100px);
    margin-left: 0;
    gap: 1.0rem;
    margin-right: auto;
}

.items-category-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.items-category-media {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 12px 30px rgba(17,24,39,.08);
}

.items-category-image,
.items-category-image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 2;
    object-fit: cover;
    object-position: center;
}

.items-category-content {
    padding: 0;
}

.items-category-description {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

/*== Product Grid ==*/
.items-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    scroll-margin-top: 110px;
}

.items-product-column {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.items-product-link {
    display: block;
    width: 100%;
    max-width: 220px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.items-product-card {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    transition:
            transform 0.25s ease,
            box-shadow 0.25s ease,
            border-color 0.25s ease;
}

.items-product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 14px 28px rgba(255, 122, 24, 0.18);
}

.items-product-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2.5;
    flex: none;
    overflow: hidden;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-sizing: border-box;
}

.items-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #fff;
    transition: transform 0.45s ease;
}

.items-product-card:hover .items-product-image {
    transform: scale(1.04);
}

.items-product-info {
    display: flex;
    min-height: 50px;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-top: 1px solid var(--primary);
    background: var(--bg);
}

.items-product-title {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.items-product-price {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

/*== Item Detail ==*/
.item-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.item-detail-panel {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 20px;
}

.item-detail-sidebar {
    display: block;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 24px;
}

.item-detail-summary {
    position: sticky;
    top: 110px;
    height: fit-content;
    border-radius: 24px;
}

.item-detail-summary > .card-content,
.item-detail-calculator .card-content {
    display: block;
}

.item-detail-media {
    margin-bottom: 1.5rem;
}

.item-detail-image-card {
    overflow: hidden;
    border-radius: 24px;
}

.item-detail-image-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.item-detail-image,
.item-detail-modal-preview {
    display: block;
    width: 100%;
    height: 320px;
    padding: 12px;
    background: #fff;
    object-fit: contain;
    object-position: center;
}

.item-detail-summary-title {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.item-detail-summary-price {
    margin-bottom: 1rem;
    font-size: 1.6rem;
    line-height: 1.1;
}

.price-row,
.price-netto,
.price-brutto {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.price-row + .price-row,
.price-brutto {
    margin-top: 0.4rem;
}

.price-value,
.price-netto,
.price-brutto {
    color: var(--primary);
    font-weight: 900;
}

.price-label,
.price-netto span,
.price-brutto span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.price-info-block{
    padding: 10px 0;
    margin: 10px 0;
}

.item-detail-description-card {
    height: auto;
    min-height: auto;
    margin-top: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
}

.item-detail-description-card .card-content {
    display: flex;
    width: 100%;
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 24px;
    margin-top: 0;
    text-align: left;
}

.item-detail-description-title {
    width: 100%;
    margin: 0 0 14px;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 900;
    text-align: left;
}

.item-detail-description-text {
    display: block;
    width: 100%;
    max-width: 100%;
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.85;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

/*== Forms ==*/
.item-detail-calculator {
    height: auto;
    margin-bottom: 1rem;
}

.item-detail-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.form-label-small {
    display: inline-block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.form-control-custom {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: center;
}

.form-control-custom:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

.number-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.number-input input {
    flex: 1;
}

.number-input button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease,
    background 0.2s ease;
}

.number-input button:hover {
    transform: translateY(-1px);
    background: #ff7a18;
}

.number-input button:active {
    transform: scale(0.95);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    display: none;
}

.item-detail-submit {
    width: 100%;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid var(--accent);
    border-radius: 100px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

/*== Modal ==*/
body.item-modal-open {
    overflow: hidden;
}

.item-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.72);
}

.item-detail-modal.is-open {
    display: flex;
}

.item-detail-modal-dialog {
    width: min(1140px, 100%);
    max-height: calc(100vh - 48px);
}

.item-detail-modal-content {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.96);
}

.item-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #fff;
}

.item-detail-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.item-detail-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #020617;
}

/*== Tables ==*/
.item-detail-page .table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.item-detail-page table {
    width: 100%;
    border-collapse: collapse;
}

.item-detail-page th,
.item-detail-page td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    vertical-align: middle;
}

.item-detail-page thead th {
    background: rgba(17, 24, 39, 0.04);
    color: var(--text);
    text-align: left;
    white-space: nowrap;
}

/*== Responsive ==*/
@media (max-width: 1200px) {
    .items-page > .container,
    .item-detail-page > .container,
    .items-page-container {
        max-width: 960px;
    }

    .items-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 22px;
    }

    .items-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .items-page > .container,
    .item-detail-page > .container,
    .items-page-container {
        max-width: 720px;
    }

    .items-page-hero {
        padding: 96px 0 72px;
        clip-path: none;
    }

    .items-layout {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 18px;
    }

    .item-detail-layout {
        grid-template-columns: 1fr;
    }

    .items-sidebar {
        top: 76px;
        max-height: calc(100vh - 96px);
    }

    .items-sidebar-inner {
        max-height: calc(100vh - 96px);
        padding: 12px;
        border-radius: 18px;
    }

    .items-sidebar-link {
        min-height: 48px;
        padding: 11px 12px;
    }

    .items-sidebar-link:hover {
        transform: none;
    }

    .items-category {
        margin-bottom: 72px;
    }

    .items-category-media {
        padding: 12px;
        border-radius: 20px;
    }

    .items-category-image,
    .items-category-image-placeholder {
        border-radius: 15px;
    }

    .items-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .item-detail-summary {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .items-page > .container,
    .item-detail-page > .container,
    .items-page-container {
        max-width: 540px;
    }

    .items-layout {
        display: flex;
        flex-direction: column;
    }

    .items-sidebar {
        position: static;
        order: -1; /* sidebar first */
        width: 100%;
        max-height: none;
        margin-bottom: 1.5rem;
    }

    .items-sidebar-inner {
        max-height: none;
        overflow: visible;
    }

    .items-layout {
        display: block;
    }

    .items-content {
        width: 100%;
    }

    .items-page-hero {
        padding: 88px 0 64px;
    }

    .items-page-hero-title {
        font-size: 2.2rem;
        line-height: 1.15;
    }

    .items-page-hero-text {
        font-size: 1rem;
    }

    .items-category {
        margin-bottom: 64px;
    }

    .items-category-card {
        gap: 18px;
        margin-bottom: 26px;
    }

    .items-category-media {
        height: auto;
        padding: 0;
        overflow: hidden;
        border-radius: 18px;
    }

    .items-category-image,
    .items-category-image-placeholder {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: center;
        border-radius: 18px;
    }

    .items-category-description {
        font-size: 0.92rem;
        line-height: 1.7;
    }

    .items-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .items-product-link {
        width: 100%;
        max-width: none;
    }

    .items-product-info {
        min-height: 72px;
        padding: 10px 8px;
    }

    .item-detail-panel,
    .item-detail-summary .card-content {
        padding: 20px;
    }

    .item-detail-image,
    .item-detail-modal-preview {
        height: 260px;
    }
}

@media (max-width: 576px) {
    .items-page > .container,
    .item-detail-page > .container,
    .items-page-container {
        max-width: none;
        padding-inline: 14px;
    }

    .items-page-hero-title {
        font-size: 2rem;
    }

    .items-category-media {
        height: auto;
    }

    .items-category-image,
    .items-category-image-placeholder {
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
    }

    .items-category-description {
        font-size: 0.9rem;
    }

    .items-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .items-product-column,
    .items-product-link,
    .items-product-card {
        width: 100%;
        max-width: none;
    }

    .items-product-card {
        border-radius: 14px;
    }

    .items-product-title {
        font-size: 0.82rem;
    }

    .items-product-price {
        font-size: 0.92rem;
    }
}

@media (max-width: 430px) {
    .items-page > .container,
    .item-detail-page > .container,
    .items-page-container {
        padding-inline: 10px;
    }

    .items-category-media {
        height: auto;
    }

    .items-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .items-product-column,
    .items-product-link,
    .items-product-card {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .items-product-image-wrap {
        aspect-ratio: 1 / 1;
    }

    .items-product-info {
        min-height: 64px;
        padding: 7px 5px;
    }

    .items-product-title {
        font-size: 0.75rem;
        line-height: 1.15;
    }

    .items-product-price {
        font-size: 0.84rem;
    }
}