/* Same-specificity cascade gotcha as below: any element with its own
   display:flex/inline-flex rule declared after .hidden in the stylesheet
   order needs an explicit override to actually hide correctly. */
#catalog-load-more.hidden,
#cart-count.hidden,
#catalog-discount-filter-label.hidden {
    display: none;
}

/* Browsers don't inherit the page font into form controls by default -
   they fall back to the OS UI font (e.g. Calibri/Segoe UI on Windows).
   This file only loads on shop-catalog.html, so the rule stays scoped to
   this page on its own without needing an extra ancestor selector. */
button, input, select, textarea {
    font-family: inherit;
}

.shop-catalog__layout {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.shop-catalog__sidebar-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: white;
    padding: 15px;
}

.shop-catalog__sidebar-card + .shop-catalog__sidebar-card {
    margin-top: 16px;
}

.shop-catalog__filters {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.shop-catalog__filters.show {
    display: flex;
}

.shop-catalog__filter-label {
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}

.shop-catalog__filter-label:first-child {
    margin-top: 0;
}

.shop-catalog__brand-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px 14px;
    max-height: 100px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
}

.shop-catalog__filters-clear {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color);
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
}

.shop-catalog__filters-clear:hover {
    background-color: var(--hover-color-light);
}

.shop-catalog__brand-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.shop-catalog__price-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-catalog__price-range input {
    width: 0;
    flex: 1;
    padding: 6px 8px;
    font-size: 13px;
}

.shop-catalog__sidebar-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.shop-catalog__sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.shop-catalog__sidebar-toggle .arrow {
    transition: transform 150ms ease-in-out;
}

.shop-catalog__sidebar-toggle--open .arrow {
    transform: rotate(180deg);
}

.shop-catalog__category-list {
    display: none;
    flex-direction: column;
    gap: 4px;
}

.shop-catalog__category-list.show {
    display: flex;
}

.shop-catalog__category-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
}

.shop-catalog__category-btn:hover {
    background-color: var(--border-color);
}

.shop-catalog__category-btn.active {
    background-color: var(--hover-color-light);
    color: var(--accent-color);
    font-weight: 700;
    border-left: 3px solid var(--accent-color);
    padding-left: 7px;
}

.shop-catalog__category-btn--group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shop-catalog__category-btn--group .arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 150ms ease-in-out;
}

.shop-catalog__category-btn--group.expanded .arrow {
    transform: rotate(180deg);
}

.shop-catalog__subcategory-list {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 6px 10px;
    padding-left: 8px;
    border-left: 2px solid var(--border-color);
}

.shop-catalog__subcategory-list.show {
    display: flex;
}

.shop-catalog__category-btn--sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 8px;
}

.shop-catalog__category-btn--sub svg {
    flex-shrink: 0;
    color: var(--table-border-color);
}

.shop-catalog__category-btn--sub.active svg {
    color: var(--accent-color);
}

.shop-catalog__main {
    min-width: 0;
}

.shop-catalog__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 15px 12px;
}

.shop-catalog__search {
    flex: 1;
    width: auto;
    margin-bottom: 0;
}

.shop-catalog__heading {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-catalog__subheading {
    text-align: center;
    color: var(--table-border-color);
    margin-bottom: 8px;
}

.shop-catalog__contacts-line {
    text-align: center;
    font-size: 13px;
    margin-bottom: 20px;
}

.shop-catalog__status {
    text-align: center;
    padding: 20px 0;
    color: var(--table-border-color);
}

.shop-catalog__grid-section-title {
    grid-column: 1 / -1;
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0 -5px;
}

.shop-catalog__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.shop-catalog__card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--main-bg-color);
    cursor: pointer;
    transition: box-shadow 150ms ease-in-out, border-color 150ms ease-in-out;
    text-align: left;
}

.shop-catalog__card:hover {
    border-color: var(--accent-color);
    box-shadow: rgba(100, 100, 111, 0.2) 0 7px 29px 0;
}

.shop-catalog__card--discount {
    border-color: #f97316;
    border-width: 2px;
}

.shop-catalog__card--discount:hover {
    border-color: #f97316;
}

.shop-catalog__discount-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background-color: #f97316;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.shop-catalog__card-price-old,
.shop-catalog__product-price-old {
    color: var(--table-border-color);
    text-decoration: line-through;
    font-weight: 400;
}

.shop-catalog__card-price-old {
    font-size: 13px;
}

.shop-catalog__product-price-old {
    font-size: 16px;
    margin: 0 6px;
}

.shop-catalog__discount-comment {
    font-size: 12px;
    font-style: italic;
    color: #b45309;
    margin-bottom: 8px;
}

#catalog-discount-filter-label {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1.5px solid #f97316;
    background-color: rgba(249, 115, 22, 0.08);
    color: #b45309;
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-catalog__card-media {
    position: relative;
    padding: 15px;
    background-color: white;
}

.shop-catalog__discount-sticker {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 60px;
    height: 60px;
    background-color: #f97316;
    clip-path: polygon(50% 0%, 59.83% 13.3%, 75% 6.7%, 76.87% 23.13%, 93.3% 25%, 86.7% 40.17%, 100% 50%, 86.7% 59.83%, 93.3% 75%, 76.87% 76.87%, 75% 93.3%, 59.83% 86.7%, 50% 100%, 40.17% 86.7%, 25% 93.3%, 23.13% 76.87%, 6.7% 75%, 13.3% 59.83%, 0% 50%, 13.3% 40.17%, 6.7% 25%, 23.13% 23.13%, 25% 6.7%, 40.17% 13.3%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    z-index: 2;
}

.shop-catalog__card-image {
    width: 80%;
    margin: 0 auto;
    aspect-ratio: 1;
    object-fit: contain;
}

.shop-catalog__card-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    width: 80%;
    margin: 0 auto;
    color: var(--table-border-color);
    font-size: 12px;
}

.shop-catalog__card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 12px 15px 15px;
}

.shop-catalog__card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-catalog__card-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.shop-catalog__card-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 16px;
}

.shop-catalog__card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-catalog__card-qty {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
}

.shop-catalog__qty-input.shop-catalog__card-qty-input {
    width: 34px;
    padding: 4px 2px;
    font-size: 12px;
    text-align: center;
}

.shop-catalog__card-buy-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 1.5px solid var(--accent-color);
    border-radius: 8px;
    background-color: white;
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease-in-out, scale 150ms ease-in-out;
}

.shop-catalog__card-buy-btn:hover {
    background-color: var(--hover-color-light);
    scale: 1.03;
}

.shop-catalog__product-modal {
    text-align: center;
}

.shop-catalog__cart-button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 30px;
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
    transition: scale 150ms ease-in-out;
}

.shop-catalog__cart-button:hover {
    scale: 1.04;
}

.shop-catalog__cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background-color: white;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
}

.shop-catalog__cart-modal {
    text-align: left;
}

.shop-catalog__cart-success {
    text-align: center;
    padding: 20px 15px;
    border-radius: 10px;
    background-color: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    font-weight: 600;
}

.shop-catalog__cart-items {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-catalog__cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--table-border-color);
}

.shop-catalog__cart-item-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--table-border-color);
    flex-shrink: 0;
}

.shop-catalog__cart-item-info {
    flex: 1;
    min-width: 0;
}

.shop-catalog__cart-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.shop-catalog__cart-item-price {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 700;
}

.shop-catalog__cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-catalog__cart-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background-color: var(--hover-color-light);
    font-weight: 700;
    cursor: pointer;
}

.shop-catalog__cart-item-remove {
    color: var(--table-border-color);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.shop-catalog__cart-item-remove:hover {
    color: red;
}

.shop-catalog__product-images {
    display: flex;
    /* "safe" keeps this centered normally, but falls back to start-aligned
       once content overflows - plain "center" would clip the start of the
       row and make it unreachable even with scroll. */
    justify-content: safe center;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.shop-catalog__product-images img {
    height: 160px;
    border-radius: 8px;
    background-color: white;
    border: 1px solid var(--table-border-color);
}

.shop-catalog__product-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.shop-catalog__stock-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.shop-catalog__stock-badge--in {
    background-color: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.shop-catalog__stock-badge--out {
    background-color: rgba(220, 38, 38, 0.12);
    color: #dc2626;
}

.shop-catalog__stock-badge--card {
    font-size: 11px;
    padding: 2px 8px;
    margin-bottom: 8px;
}

.shop-catalog__product-price {
    font-size: 22px;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 15px;
}

.shop-catalog__copy-link-btn {
    display: inline-block;
    margin-bottom: 15px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--table-border-color);
    cursor: pointer;
    transition: color 150ms ease-in-out, border-color 150ms ease-in-out;
}

.shop-catalog__copy-link-btn:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.shop-catalog__qty-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.shop-catalog__qty-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid var(--table-border-color);
    border-radius: 8px;
}

.shop-catalog__buy-button {
    width: auto;
    margin: 0 0 20px 0;
    display: inline-flex;
}

.shop-catalog__buy-button:disabled {
    background-color: var(--table-border-color);
    cursor: not-allowed;
    box-shadow: none;
}

.shop-catalog__buy-button:disabled:hover {
    scale: 1;
}

.shop-catalog__product-description {
    text-align: left;
    font-size: 16px;
    white-space: pre-line;
}

.shop-catalog__product-options {
    text-align: left;
    margin: 15px 0;
    font-size: 14px;
}

.shop-catalog__product-options div:not(:last-child) {
    border-bottom: 1px solid var(--table-border-color);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

@media screen and (min-width: 768px) {
    .shop-catalog__layout {
        flex-direction: row;
        align-items: flex-start;
    }

    .shop-catalog__content {
        margin-top: 160px;
    }

    .shop-catalog__sidebar {
        width: 240px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }

    .shop-catalog__sidebar-card {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .shop-catalog__sidebar-toggle {
        cursor: default;
        flex-shrink: 0;
    }

    .shop-catalog__sidebar-toggle .arrow {
        display: none;
    }

    .shop-catalog__category-list {
        display: flex;
    }

    .shop-catalog__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1100px) {
    .shop-catalog__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
