.mahant-product-catalog {
    --mahant-red: #EB3300;
    --mahant-black: #171717;
    --mahant-secondary: #5F5E5E;
    --mahant-grey: #737373;
    --mahant-border: #E2E2E2;
    --mahant-surface: #F9F9F9;
    --mahant-white: #FFFFFF;
    width: 100%;
}

.mahant-product-catalog,
.mahant-product-catalog * {
    box-sizing: border-box;
}

.mahant-product-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.mahant-product-search .mahant-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 1;
}

.mahant-product-search .mahant-search-icon svg,
.mahant-category-filter-control .mahant-filter-icon svg {
    display: block;
}

.mahant-category-filter-control {
    position: relative;
    display: inline-flex;
    width: auto;
    flex: 0 0 auto;
}

.mahant-category-filter-control .mahant-category-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    box-sizing: border-box;
}

.mahant-category-filter-control .mahant-filter-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}

.mahant-product-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(420px, 100%);
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--mahant-search-border);
    background: var(--mahant-search-bg);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mahant-product-search:focus-within {
    border-color: var(--mahant-search-focus-border);
    box-shadow: 0 0 0 2px rgba(235,51,0,.08);
}

.mahant-product-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--mahant-search-text) !important;
    font: inherit;
}

.mahant-product-search input::placeholder {
    color: var(--mahant-search-placeholder) !important;
    opacity: 1;
}

.mahant-search-icon {
    color: var(--mahant-secondary);
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.mahant-category-select {
    min-width: 190px;
    min-height: 50px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--mahant-filter-border);
    border-radius: 0;
    background-color: var(--mahant-filter-bg);
    color: var(--mahant-filter-text);
    font: inherit;
    cursor: pointer;
    outline: 0;
}

.mahant-category-select:focus {
    border-color: var(--mahant-filter-border);
    box-shadow: 0 0 0 2px rgba(235,51,0,.08);
}

.mahant-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    transition: opacity .2s ease;
}

.mahant-product-grid.is-loading {
    opacity: .45;
    pointer-events: none;
}

.mahant-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--mahant-card-border);
    border-radius: 0;
    background: var(--mahant-card-bg);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--mahant-card-shadow);
    transform: translateY(0);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.mahant-product-card:hover,
.mahant-product-card:focus-visible {
    transform: translateY(-2px);
    background-color: var(--mahant-card-hover-bg);
    box-shadow: var(--mahant-card-hover-shadow);
    outline: none;
}

.mahant-product-image {
    position: relative;
    width: 100%;
    height: 300px;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--mahant-card-border);
    background: var(--mahant-image-bg);
}

.mahant-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: darken;
    opacity: var(--mahant-image-opacity);
    transition: transform .5s ease;
}

.mahant-product-card:hover .mahant-product-image img {
    transform: scale(1.05);
}

.mahant-product-code {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 10px;
    border-radius: 0;
    background: var(--mahant-badge-bg);
    color: var(--mahant-badge-text);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mahant-image-placeholder {
    color: var(--mahant-grey);
    font-size: 13px;
}

.mahant-product-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 86px;
    padding: 20px 24px;
}

.mahant-product-card-body h3 {
    margin: 0;
    color: var(--mahant-title-color);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.mahant-product-card-body p {
    display: none;
}

.mahant-product-card-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.mahant-card-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mahant-action-color);
    font-size: 25px;
    line-height: 1;
    transition: color .2s ease;
}

.mahant-product-card:hover .mahant-card-icon {
    color: var(--mahant-action-hover);
}

.mahant-no-products,
.mahant-product-notice {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed var(--mahant-border);
    background: var(--mahant-white);
    text-align: center;
    color: var(--mahant-secondary);
}

/* Popup */
.mahant-product-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mahant-product-modal.is-open {
    display: flex;
}

.mahant-product-modal-overlay {
    position: absolute;
    inset: 0;
    background: var(--mahant-popup-overlay);
    backdrop-filter: blur(5px);
}

.mahant-product-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 960px);
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid var(--mahant-popup-border);
    border-radius: 0;
    background: var(--mahant-popup-bg);
    box-shadow: 0 25px 80px rgba(0,0,0,.20);
}

.mahant-product-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border-bottom: 1px solid var(--mahant-popup-header-border);
    background: var(--mahant-popup-header-bg);
    flex: 0 0 auto;
}

.mahant-popup-header-content {
    flex: 1 1 auto;
    min-width: 0;
}

.mahant-modal-code {
    margin-bottom: 7px;
    color: var(--mahant-popup-code);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mahant-modal-title {
    margin: 0;
    color: var(--mahant-popup-title);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}

.mahant-modal-close {
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0 !important;
    background: transparent !important;
    color: var(--mahant-popup-close);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.mahant-modal-close:hover {
    color: var(--mahant-popup-close-hover);
}

.mahant-product-modal-content {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.mahant-popup-image {
    width: 100%;
    height: 300px;
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid var(--mahant-border);
    background: var(--mahant-popup-image-bg);
}

.mahant-popup-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: darken;
    opacity: var(--mahant-popup-image-opacity);
}

.mahant-popup-image.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mahant-grey);
}

.mahant-modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 28px;
}

.mahant-modal-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--mahant-border);
    border-radius: 0;
    background: var(--mahant-popup-badge-bg);
    color: var(--mahant-popup-badge-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mahant-modal-section-title {
    margin: 0 0 16px;
    color: var(--mahant-title-color);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: .01em;
}

.mahant-spec-table-wrap {
    width: 100%;
    max-width: 100%;
    display: block !important;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--mahant-table-border);
    -webkit-overflow-scrolling: touch;
}

.mahant-spec-table {
    width: 100% !important;
    min-width: 680px;
    margin: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    display: table !important;
}

.mahant-spec-table thead {
    display: table-header-group !important;
}

.mahant-spec-table tbody {
    display: table-row-group !important;
}

.mahant-spec-table tr {
    display: table-row !important;
    position: static !important;
}

.mahant-spec-table th,
.mahant-spec-table td {
    display: table-cell !important;
    float: none !important;
    vertical-align: middle !important;
    height: auto !important;
    white-space: nowrap !important;
    border: 0 !important;
    border-right: 1px solid var(--mahant-table-border) !important;
    border-bottom: 1px solid var(--mahant-table-border) !important;
    padding: 16px !important;
    text-align: left !important;
}

.mahant-spec-table th:last-child,
.mahant-spec-table td:last-child {
    border-right: 0 !important;
}

.mahant-spec-table th {
    background: var(--mahant-table-header-bg) !important;
    color: var(--mahant-table-header-text) !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mahant-spec-table td {
    background: var(--mahant-table-row-bg) !important;
    color: var(--mahant-table-row-text) !important;
    font-size: 13px;
    line-height: 1.4;
}

.mahant-spec-table tbody tr:nth-child(even) td {
    background: var(--mahant-table-alt-row-bg) !important;
}

.mahant-spec-table tbody tr:hover td {
    background: #E8E8E8 !important;
}

.mahant-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 28px;
}

.mahant-modal-button {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--mahant-black);
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.mahant-modal-button.secondary {
    background: var(--mahant-button-secondary-bg);
    color: var(--mahant-button-secondary-text);
}

.mahant-modal-button.secondary:hover {
    background: #E8E8E8;
}

.mahant-modal-button.primary {
    border-color: var(--mahant-red);
    background: var(--mahant-button-primary-bg);
    color: var(--mahant-button-primary-text);
}

.mahant-modal-button.primary:hover {
    border-color: var(--mahant-button-primary-hover);
    background: var(--mahant-button-primary-hover);
}

@media (max-width: 1024px) {
    .mahant-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .mahant-product-toolbar {
        align-items: stretch;
        margin-bottom: 32px;
    }

    .mahant-product-search,
    .mahant-category-select {
        width: 100%;
        min-width: 0;
    }

    .mahant-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .mahant-product-image {
        height: 200px;
    }

    .mahant-product-card-body {
        min-height: 70px;
        padding: 16px;
    }

    .mahant-product-card-body h3 {
        font-size: 18px;
    }

    .mahant-product-modal {
        padding: 8px;
    }

    .mahant-product-modal-dialog {
        max-height: calc(100vh - 16px);
    }

    .mahant-product-modal-header,
    .mahant-product-modal-content {
        padding: 16px;
    }

    .mahant-modal-title {
        font-size: 23px;
    }

    .mahant-popup-image {
        height: 200px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .mahant-product-grid {
        grid-template-columns: 1fr;
    }

    .mahant-product-image {
        height: 260px;
    }
}
