/*
 * Gimolost Override v2 for xt:Commerce 6.8.1 / xt_responsive
 * ---------------------------------------------------------
 * Base template remains xt_responsive. This file contains only Gimolost styling.
 * v2 adds product cards, product sliders and subcategory cards to the working v1 setup.
 */

/* ---------- start page intro ---------- */
#startpage-content {
    margin-bottom: 18px;
}

/* ---------- shared headings ---------- */
.gimolost-section-title {
    margin: 22px 0 11px;
    font-family: "pt_sansbold", Helvetica, Arial, sans-serif;
    font-size: 21px;
    font-weight: normal;
    line-height: 1.1;
    color: #333333;
    text-transform: uppercase;
}

/* ---------- automatic categories on the start page ---------- */
#box-start-page-categories.gimolost-start-categories {
    margin: 0 0 26px;
    font-size: 1em;
}

#box-start-page-categories.gimolost-start-categories .row,
.gimolost-subcategory-grid .row {
    margin-left: -8px;
    margin-right: -8px;
}

#box-start-page-categories.gimolost-start-categories .col,
.gimolost-subcategory-grid .col {
    padding-left: 8px;
    padding-right: 8px;
}

.gimolost-category-card {
    display: block;
    margin-bottom: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #333333;
    text-decoration: none !important;
    transition: border-color .15s ease, color .15s ease;
}

.gimolost-category-card:hover,
.gimolost-category-card:focus {
    border-color: #b35500;
    color: #663100;
    text-decoration: none !important;
}

.gimolost-category-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    overflow: hidden;
    background: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
}

.gimolost-category-card__image img {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    object-fit: cover;
}

.gimolost-category-card__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #bdbdbd;
    font-size: 38px;
}

.gimolost-category-card__title {
    display: block;
    min-height: 43px;
    padding: 10px 11px;
    font-family: "pt_sansbold", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.35;
    color: inherit;
}

/* ---------- subcategories on category pages ---------- */
.gimolost-subcategory-grid {
    margin: 22px 0 18px;
}

.categorie-listing.gimolost-subcategory-grid .section {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.gimolost-subcategory-grid .gimolost-category-card__image {
    height: 135px;
}

.gimolost-subcategory-grid .gimolost-category-card__title {
    min-height: 41px;
    font-size: 15px;
}

/* ---------- product grid on category/search/manufacturer pages ---------- */
.gimolost-product-grid {
    display: flex;
    flex-wrap: wrap;
}

.gimolost-product-grid > .col {
    display: flex;
    float: none;
}

.gimolost-product-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 30px !important;
    overflow: hidden;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    background: #ffffff;
    box-shadow: none !important;
    transition: border-color .15s ease;
}

.gimolost-product-card:hover {
    border-color: #b8b8b8 !important;
}

.gimolost-product-card .section-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0 !important;
}

.gimolost-product-card .gimolost-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    margin: 0 !important;
    overflow: hidden;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.gimolost-product-card .gimolost-product-image .image-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    padding: 10px;
}

.gimolost-product-card .gimolost-product-image img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    object-fit: contain;
}

.gimolost-product-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 13px 14px 10px;
}

.gimolost-product-card .title {
    margin: 0 0 8px;
}

.gimolost-product-card .title .h4 {
    min-height: 44px;
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

.gimolost-product-card .title .h4 a {
    display: -webkit-box;
    overflow: hidden;
    color: #333333;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gimolost-product-card .title .h4 a:hover,
.gimolost-product-card .title .h4 a:focus {
    color: #b35500;
}

.gimolost-product-card .product-reviews {
    min-height: 18px;
    margin: 0 0 5px;
}

.gimolost-product-card .product-price {
    margin: auto 0 2px;
    font-size: 19px;
    color: #333333;
}

.gimolost-product-card .vpe,
.gimolost-product-card .product-tax-shipping,
.gimolost-product-card .product-stock,
.gimolost-product-card .gimolost-available-soon {
    margin: 2px 0 0;
    color: #777777;
    font-size: 12px;
    line-height: 1.35;
}

.gimolost-product-card .section-footer {
    margin: 0 !important;
    padding: 0 14px 14px !important;
}

.gimolost-product-card .gimolost-card-actions {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.gimolost-product-card .gimolost-card-actions .btn {
    float: none !important;
    min-width: 0 !important;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.2;
}

.gimolost-product-card .gimolost-card-actions .gimolost-details-btn {
    flex: 1 1 auto;
    text-align: center;
}

.gimolost-product-card .gimolost-card-actions .btn-cart,
.gimolost-product-card .gimolost-card-actions .notify {
    flex: 0 0 42px;
    width: 42px;
}

/* ---------- product sliders: Neuheiten, Bestseller, etc. ---------- */
.product-slider .gimolost-product-card {
    margin: 0 7px 8px !important;
}

.product-slider .gimolost-product-card .gimolost-product-image {
    height: 205px;
}

/* ---------- responsive ---------- */
@media (max-width: 991px) {
    .gimolost-category-card__image {
        height: 140px;
    }

    .gimolost-product-card .gimolost-product-image {
        height: 205px;
    }
}

@media (max-width: 767px) {
    .gimolost-section-title {
        margin-top: 18px;
        font-size: 19px;
    }

    #box-start-page-categories.gimolost-start-categories {
        margin-bottom: 18px;
    }

    .gimolost-category-card__image {
        height: 125px;
    }

    .gimolost-category-card__title {
        min-height: 40px;
        padding: 9px;
        font-size: 14px;
    }

    .gimolost-product-card .gimolost-product-image,
    .product-slider .gimolost-product-card .gimolost-product-image {
        height: 220px;
    }

    .gimolost-product-card__content {
        padding: 12px 13px 9px;
    }

    .gimolost-product-card .section-footer {
        padding: 0 13px 13px !important;
    }
}

@media (max-width: 420px) {
    .gimolost-category-card__image {
        height: 110px;
    }
}

/* ==========================================================
   Gimolost UI v2.1 — polish / robustness
   ========================================================== */

/* Category image fallback: placeholder stays underneath the real image.
   If a DB image reference exists but the processed file is missing,
   the img onerror handler hides it and the placeholder remains visible. */
.gimolost-category-card__image {
    position: relative;
}

.gimolost-category-card__placeholder {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #f7f7f7;
}

.gimolost-category-card__actual-image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    background: #ffffff;
}

/* Category descriptions: only JS adds the collapsed class, so without JS
   the full content remains accessible. */
.gimolost-category-description {
    margin-bottom: 12px;
}

.gimolost-category-description__content.is-collapsed {
    position: relative;
    max-height: 10.2em;
    overflow: hidden;
}

.gimolost-category-description__content.is-collapsed::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3.2em;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 90%);
}

.gimolost-category-description__toggle {
    margin: 2px 0 8px;
    padding: 3px 0;
    border: 0;
    color: #b35500;
    font-family: "pt_sansbold", Helvetica, Arial, sans-serif;
    text-decoration: none;
}

.gimolost-category-description__toggle:hover,
.gimolost-category-description__toggle:focus {
    color: #7d3b00;
    text-decoration: underline;
}

/* Product detail hierarchy — keeps xt_responsive structure, just makes the
   important information easier to scan. */
#product .product-info > .title {
    margin-top: 0;
    margin-bottom: 8px;
    color: #333333;
    font-size: 26px;
    line-height: 1.18;
}

#product .product-info .product-model {
    margin-bottom: 10px;
    color: #777777;
}

#product .product-info .product-price.this {
    margin: 14px 0 3px;
    color: #333333;
    font-family: "pt_sansbold", Helvetica, Arial, sans-serif;
    font-size: 28px;
    line-height: 1.15;
}

#product .product-info .product-price.this .product-tax {
    color: #777777;
    font-family: "pt_sansregular", Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: normal;
}

#product .product-info .product-meta-info {
    margin-top: 4px;
    margin-bottom: 10px;
}

#product .product-info .product-meta-info.bold {
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
}

#product .product-info .add-to-cart {
    margin-top: 8px;
    padding: 12px;
    border: 1px solid #e5e5e5;
    background: #f8f8f8;
}

#product .product-info .add-to-cart .form-inline {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

#product .product-info .add-to-cart .input-group {
    flex: 0 1 auto;
}

#product .product-info .add-to-cart .btn-cart {
    flex: 1 1 auto;
    min-width: 130px;
}

/* Make the final 'show all' entry in category dropdowns look intentional. */
.navbar-nav .dropdown-menu .dropdown-header {
    font-weight: 700;
}

@media (max-width: 767px) {
    #product .product-info > .title {
        margin-top: 10px;
        font-size: 23px;
    }

    #product .product-info .product-price.this {
        font-size: 25px;
    }

    #product .product-info .add-to-cart .form-inline {
        display: block;
    }

    #product .product-info .add-to-cart .input-group,
    #product .product-info .add-to-cart .btn-cart {
        width: 100%;
    }

    #product .product-info .add-to-cart .btn-cart {
        margin-top: 8px;
    }
}
