/* Grundstruktur */
.product-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* BREADCRUMB */
.breadcrumb {
    padding: 20px;
}

/* Container: Galerie + Infos nebeneinander auf Desktop */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Galerie */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-image {
    width: 400px;
    height: 400px;
    position: relative; /* Wichtig für absolute Positionierung des Badges */
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.thumbnail-row {
    display: flex;
    gap: 10px;
}

.thumbnail-row img {
    width: 70px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumbnail-row img.selected {
    border-color:  #111;;
}

/* Produktinfos rechts */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-info h1 {
    margin: 0;
    font-size: 28px;
}

.price {
    font-size: 26px;
    font-weight: bold;
    color: #e60023;
}

/* ---------- FARBE ---------- */
.color-selection p {
    font-weight: 500;
}

.color-img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.color-img:hover {
    transform: scale(1.05);
}

.color-img.selected-color {
    border-color: #111;
    transform: scale(1.1); /* stärker sichtbar */
    transition: all 0.2s ease; /* sicherstellen, dass Hover/Select smooth ist */
}


/* ---------- SIZE GRID ---------- */
.size-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, 60px);
    gap: 10px;
}

.size-box {
    width: 40px;
    height: 40px;
    display: flex;
    font-size: 16px;
    align-items: center;
    justify-content: center;

    border: 1px solid #ddd;
    border-radius: 10px;

    font-weight: 500;
    cursor: pointer;

    transition: all 0.2s ease;
}

.size-box:hover {
    border-color: black;
}

.size-box.selected {
    border: 2px solid black;
    background: #f5f5f5;
}

.size-box.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
    position: relative; /* wichtig für das Pseudoelement */
}

.size-box.disabled::after {
    content: "Nicht geführt";
    position: absolute;
    bottom: -22px; /* Tooltip unter dem Element */
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    background: black;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    display: none; /* standardmäßig ausblenden */
    white-space: nowrap;
    z-index: 10;
}

.size-box.disabled:hover::after {
    display: block; /* beim Hover anzeigen */
}

.size-box.out-of-stock {
    position: relative;
    opacity: 0.5;
}

.size-box.out-of-stock::after {
    content: "✕";
    position: absolute;
    color: black;
    font-weight: bold;
}

.size-box.out-of-stock:hover::before {
    content: "Ausverkauft";
    position: absolute;
    bottom: -25px; /* mehr Platz für Tooltip */
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    background: black;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
}


/* ---------- BUTTON ---------- */
.product-info button {
    margin-top: 15px;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: black;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-info button:hover {
    background: #333;
}


/* ---------- PRICE ---------- */
.price {
    font-size: 30px;
    font-weight: 700;
    color: black;
}
/* Beschreibung */
.product-description {
    grid-column: 1 / -1; /* über gesamte Breite */
    margin-top: 40px;
}

/* Responsive Anpassung für kleine Bildschirme */
@media (max-width: 480px) {
    .price-note {
        font-size: 0.7em; /* etwas kleiner auf Handys */
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-description {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .thumbnail-row {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .thumbnail-row img {
        flex: 0 0 auto;
        width: 50px;
        height: 50px;
    }
}

/*  PREISBOX */

/* Zeile: neuer Preis + Badge */
.price-row {
    display: flex;
    align-items: center;
    gap: 6px;

    justify-content: flex-start; /*  kein Verteilen */
}

/* Rabatt → rot */
.price-box .old-price + .new-price {
    color: red;
}

/* Container */
.price-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* obere Zeile */
.old-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* alter Preis */
.old-price {
    text-decoration: line-through;
    color: gray;
    font-size: 0.9rem;
}

/* neuer Preis (Hauptfokus) */
.new-price {
    font-weight: bold;
    font-size: 1.6rem;
    color: red;
}

/* Badge */
.discount-badge {
    background: red;
    color: white;
    font-weight: bold;

    padding: 2px 6px;
    font-size: 14px;
    border-radius: 6px;

    display: inline-block;
    white-space: nowrap;
}

/* Hinweis */
.price-note {
    font-size: 0.6em;  /* Standardgröße für Desktop */
    color: gray;        /* graue Schriftfarbe */
    display: block;     /* unter dem Preis */
    margin-top: 2px;    /* kleiner Abstand nach oben */
}

.sale-badge {
    position: absolute;
    top: 10px;          /* Abstand von oben */
    left: 10px;         /* Abstand von links */
    width: 40px;        /* Durchmesser Kreis */
    height: 40px;
    background-color: red;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 50%; /* Kreisform */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;        /* über dem Bild */
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Main image + Zoom */
.main-image-wrapper {
    width: 400px;
    height: 400px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.main-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.main-image-wrapper img:hover {
    transform: scale(1.2); /* leichter Zoom */
}

/* Sale badge */
.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background-color: red;
    color: white;
    font-weight: bold;
    font-size: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Thumbnail container */
.thumbnail-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

/* Navigation buttons */
.thumb-nav {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.thumb-nav.hidden {
    display: none; /* unsichtbar, wenn keine Scrollbarkeit nötig */
}

.thumb-nav:hover {
    background: rgba(0,0,0,0.8);
}

/* Thumbnail row */
.thumbnail-row {
    display: flex;
    gap: 10px;
    overflow-x: hidden; /* Scrollen per JS */
    max-width: calc(70px * 4 + 10px * 3); /* 4 Thumbnails + Lücken */
    scroll-behavior: smooth;
}

.thumbnail-row img {
    width: 70px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.thumbnail-row img.selected {
    border-color: #111;
}

/* Pfeile rechts/links positionieren */
.thumb-nav.left {
    left: -20px;
}

.thumb-nav.right {
    right: -20px;
}

#imageZoomOverlay {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

#imageZoomOverlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px; /* Abstand zwischen Sternen und Zahl */
}

.stars {
    font-size: 1.5rem; /* oder 24px, 2rem etc. */
    /*color: gold;*/
}

.stars span {
    font-size: 2.2rem;
    /*text-shadow: 0 0 2px rgba(0,0,0,0.2);*/
}
.review-count-link {
    font-size: 1.2rem;
    color: #303ad5;
    text-decoration: none;
}

.average-rating {
    font-size: 18px;
    font-weight: 700;
}

.add-to-cart-form {
    margin-top: 20px;
}

.quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.quantity-row input {
    width: 80px;
    padding: 8px 10px;
}
.hidden {
    display: none !important;
}

.cart-success-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.cart-success-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
}

.cart-success-dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 560px);
    margin: 8vh auto 0;
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.cart-success-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #333;
}

.cart-success-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.cart-success-check {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.cart-success-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.cart-success-subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.cart-success-product {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.cart-success-product-image-wrap {
    position: relative;
}

.cart-success-product-image {
    width: 96px;
    height: 116px;
    object-fit: cover;
    border-radius: 12px;
    background: #f4f4f4;
}

.cart-success-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.cart-success-product-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

.cart-success-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cart-success-product-price .old-price {
    color: #888;
    text-decoration: line-through;
    font-size: 14px;
}

.cart-success-product-price .new-price {
    color: #111;
    font-weight: 700;
    font-size: 17px;
}

.cart-success-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    
}

.cart-success-actions .primary-btn,
.cart-success-actions .secondary-btn {
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    box-sizing: border-box;
    background-color : black;
    color: white;
}

@media (max-width: 640px) {
    .cart-success-dialog {
        width: calc(100vw - 20px);
        margin-top: auto;
        margin-bottom: 0;
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 0;
        border-radius: 18px 18px 0 0;
        padding: 18px;
    }

    .cart-success-product {
        grid-template-columns: 82px 1fr;
        gap: 12px;
    }

    .cart-success-product-image {
        width: 82px;
        height: 100px;
    }

    .cart-success-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Product Detail: Verkäufer, Chat, Merkliste
   ========================================================= */

.product-action-panel {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-seller-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    background: #fafafa;
    font-size: 15px;
}

.product-seller-label {
    color: #555;
}

.product-seller-name {
    font-weight: 700;
    color: #111;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-action-success,
.product-action-error {
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 14px;
}

.product-action-success {
    background: #e9f8ef;
    color: #0b6b2a;
}

.product-action-error {
    background: #ffe8e8;
    color: #9b111e;
}

.product-main-action-form,
.product-wishlist-form {
    margin: 0;
}

.product-action-btn {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.product-chat-btn,
.product-cart-btn {
    background: #111;
    color: #fff;
}

.product-chat-btn:hover,
.product-cart-btn:hover {
    background: #333;
}

.product-wishlist-btn {
    background: #fff;
    color: #111;
    border: 1px solid #d7d7d7;
}

.product-wishlist-btn:hover {
    background: #f6f6f6;
    border-color: #111;
}

.product-wishlist-btn.is-saved {
    background: #ccc;
    border-color: #ccc;
}

.product-wishlist-btn i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .product-action-btn {
        min-height: 50px;
        font-size: 15px;
    }
}

/* =========================================================
   Product Description Collapse
   ========================================================= */

.product-description-collapsible {
    position: relative;
}

.product-description-text {
    line-height: 1.7;
    overflow: hidden;
    white-space: normal;
}

.product-description-text.is-collapsed {
    max-height: 14em;
}

.product-description-collapsible.has-overflow
.product-description-text.is-collapsed::after {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        #ffffff 82%
    );
    bottom: 0;
    content: "";
    height: 4em;
    left: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
}

.product-description-toggle {
    background: transparent;
    border: 0;
    color: #111;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    margin-top: 0.8rem;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 768px) {
    .product-description-text.is-collapsed {
        max-height: 11.5em;
    }
}