html {
    font-size: 16px;
}

body {
    background-color: #ffffff;
    color: #212529;
    font-family: Arial, Helvetica, sans-serif;
}

body.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #000000;
    text-decoration: none;
}

a:hover {
    color: #000000;
    text-decoration: underline;
}

.brand-navbar {
    background-color: #343a40;
}

.brand-header {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}

.brand-logo {
    max-width: 100%;
    height: auto;
}

.brand-summary {
    font-size: 0.95rem;
    line-height: 1.7;
}

.header-divider {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.site-main {
    flex: 1 0 auto;
}

.sidebar-box {
    margin-bottom: 1rem;
}

.search-submit-button {
    background: linear-gradient(135deg, #111827 0%, #2f4858 100%);
    color: #fff;
    border: 1px solid #111827;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 26px rgba(17, 24, 39, 0.2);
}

.search-submit-button:hover,
.search-submit-button:focus {
    background: linear-gradient(135deg, #1f2937 0%, #365c70 100%);
    color: #fff;
    border-color: #1f2937;
}

.category-toggle-button {
    margin-bottom: 0.75rem;
    background: #212529;
    color: #fff;
    border: 1px solid #212529;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 24px rgba(33, 37, 41, 0.18);
}

.category-toggle-button:hover,
.category-toggle-button:focus {
    background: #343a40;
    color: #fff;
    border-color: #343a40;
}

.category-menu {
    display: block;
}

.sidebar-title {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.category-list .list-group-item {
    padding: 0;
}

.category-link,
.category-list .list-group-item > a {
    display: block;
    padding: 0.75rem 1rem;
}

.category-list .list-group-item.active,
.category-link.active {
    background-color: #0d6efd;
    color: #ffffff;
}

.category-list .list-group-item.active a,
.category-list .list-group-item.active a:hover,
.category-link.active,
.category-link.active:hover {
    color: #ffffff;
    text-decoration: none;
}

.category-indent-0 { padding-left: 0; }
.category-indent-1 { padding-left: 1rem; }
.category-indent-2 { padding-left: 2rem; }
.category-indent-3 { padding-left: 3rem; }
.category-indent-4 { padding-left: 4rem; }

.content-header {
    margin-bottom: 1rem;
}

.content-header h1 {
    margin-bottom: 0.4rem;
    font-size: 1.8rem;
}

.product-card {
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.product-card-image-link {
    display: block;
}

.product-logo {
    object-fit: contain;
    height: 170px;
    padding: 1rem;
    background-color: #f8f9fa;
}

.product-title-link:hover {
    text-decoration: underline;
}

.product-card-title {
    font-size: 1.1rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.attribute-summary {
    margin: 0.75rem 0 0;
    padding-left: 1rem;
    font-size: 0.9rem;
}

.contact-page {
    padding-bottom: 2rem;
}

.contact-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.contact-card,
.contact-map-wrap {
    border: 1px solid #d7d7d7;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    padding: 1.5rem;
    height: 100%;
}

.contact-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid #dee2e6;
}

.contact-item:first-child {
    padding-top: 0;
}

.contact-item:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.contact-label {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.contact-logo-wrap {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.contact-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.contact-map {
    width: 100%;
    min-height: 450px;
    border: 0;
}

.grant-page {
    padding: 2rem 0;
}

.grant-card {
    border: 1px solid #d7d7d7;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    padding: 2rem 1.5rem;
}

.grant-title {
    margin-bottom: 1.5rem;
}

.grant-content {
    max-width: 900px;
    margin: 0 auto 1.5rem;
}

.grant-content p {
    margin-bottom: 1rem;
}

.grant-image-wrap {
    display: flex;
    justify-content: center;
}

.grant-image {
    max-width: 100%;
    height: auto;
}

.admin-auth-page,
.admin-page {
    padding: 2rem 0;
}

.admin-auth-card,
.admin-form-card,
.admin-summary-card {
    border: 1px solid #d7d7d7;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    padding: 1.5rem;
}

.admin-auth-card {
    max-width: 460px;
    margin: 0 auto;
}

.admin-page-header {
    margin-bottom: 1.5rem;
}

.admin-page-header-inline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.admin-page-title {
    margin-bottom: 0.4rem;
}

.admin-summary-card {
    height: 100%;
}

.admin-summary-card h2 {
    margin-bottom: 0.75rem;
}

.admin-summary-count {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.admin-actions {
    white-space: nowrap;
}

.admin-image-upload-note {
    display: flex;
    align-items: center;
    min-height: 100%;
    padding: 0.85rem 1rem;
    border: 1px dashed #c8c8c8;
    background: #fafafa;
    color: #5c6770;
}

.admin-image-header {
    margin-bottom: 1rem;
}

.admin-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.admin-image-card {
    border: 1px solid #d7d7d7;
    background: #fff;
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
}

.admin-image-preview {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f8f9fa;
    border: 1px solid #ececec;
}

.admin-image-meta {
    display: grid;
    gap: 0.3rem;
}

.admin-image-name {
    font-size: 0.9rem;
    word-break: break-word;
}

.admin-image-badge {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 700;
}

.admin-image-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-logout-button {
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
}

.details-page {
    padding-bottom: 2rem;
}

.details-back-link {
    color: #495057;
    font-size: 0.95rem;
}

.product-detail-card,
.detail-attributes-section {
    border: 1px solid #d7d7d7;
    padding: 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    margin-bottom: 1.5rem;
}

.detail-gallery {
    display: grid;
    gap: 1rem;
}

.detail-main-image-button,
.detail-thumbnail-button,
.detail-gallery-tile,
.gallery-filmstrip-button,
.gallery-close,
.gallery-nav,
.gallery-zoom {
    border: 0;
    background: transparent;
    padding: 0;
}

.detail-main-image-button {
    display: block;
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #ddd;
    cursor: zoom-in;
}

.detail-main-image {
    width: 100%;
    height: 420px;
    object-fit: contain;
    display: block;
}

.detail-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.75rem;
}

.detail-thumbnail-button,
.detail-gallery-tile,
.gallery-filmstrip-button {
    border: 1px solid #d9d9d9;
    background: #fff;
    cursor: pointer;
}

.detail-thumbnail-button.is-primary {
    border-color: #212529;
}

.detail-thumbnail-image,
.detail-gallery-tile-image,
.gallery-filmstrip-image {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.detail-meta {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0.4rem;
}

.detail-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.detail-price-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 1rem;
}

.detail-price {
    font-size: 1.75rem;
    font-weight: 700;
}

.detail-summary {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.detail-description {
    line-height: 1.7;
}

.detail-section-title {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.detail-attributes-table-wrap {
    overflow-x: auto;
}

.detail-attributes-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-attributes-table th,
.detail-attributes-table td {
    border: 1px solid #212529;
    padding: 0.75rem 0.9rem;
    vertical-align: top;
}

.detail-attributes-table th {
    width: 32%;
    background: #f7f7f7;
}

.detail-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.detail-gallery-tile-image {
    height: 150px;
}

.gallery-modal[hidden] {
    display: none;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
}

.gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.gallery-dialog {
    position: relative;
    z-index: 1;
    max-width: min(1200px, calc(100vw - 2rem));
    margin: 1rem auto;
    height: calc(100vh - 2rem);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "close close close"
        "prev stage next"
        "filmstrip filmstrip filmstrip";
    gap: 1rem;
    align-items: center;
}

.gallery-stage {
    grid-area: stage;
    min-width: 0;
    margin: 0;
    height: 100%;
    display: grid;
    align-items: center;
}

.gallery-image {
    max-width: 100%;
    max-height: calc(100vh - 10rem);
    margin: 0 auto;
    display: block;
    transform-origin: center center;
    transition: transform 0.2s ease;
}

.gallery-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    margin-top: 0.75rem;
    gap: 1rem;
}

.gallery-zoom {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.35rem 0.65rem;
}

.gallery-close,
.gallery-nav {
    color: #fff;
    font-size: 2rem;
    margin-top: 0.5rem;
}

.gallery-close {
    grid-area: close;
    justify-self: end;
    align-self: start;
}

.gallery-nav {
    align-self: center;
    padding: 0 0.4rem;
}

.gallery-prev {
    grid-area: prev;
}

.gallery-next {
    grid-area: next;
}

.gallery-filmstrip {
    grid-area: filmstrip;
    grid-column: 1 / -1;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.gallery-filmstrip-button.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.brand-footer {
    margin-top: 2rem;
    padding: 1rem 0 2rem;
    color: #6c757d;
    text-align: center;
    flex-shrink: 0;
}

.brand-footer a {
    color: inherit;
    text-decoration: underline;
}

.cookie-popup[hidden] {
    display: none;
}

.cookie-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1080;
    padding: 0 0 1rem;
}

.cookie-popup-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(17, 24, 39, 0.96);
    color: #fff;
    border-radius: 1rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.cookie-popup-text {
    margin: 0;
}

.cookie-popup-button {
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .brand-summary {
        text-align: left;
        margin-top: 1rem;
    }

    .detail-main-image {
        height: 320px;
    }

    .category-menu {
        margin-top: 0.75rem;
    }

    .cookie-popup {
        padding: 0 0.75rem 0.75rem;
    }

    .cookie-popup-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-dialog {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "close"
            "stage"
            "filmstrip";
    }

    .gallery-close {
        justify-self: end;
        margin-top: 0;
    }

    .gallery-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    .gallery-prev {
        left: 0.25rem;
    }

    .gallery-next {
        right: 0.25rem;
    }
}
