/* shop/public/css/cart.css */

/* =========================
   🔥 GLOBAL BUTTONS
   ========================= */
.btn {
    display: inline-block;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #ccc;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: #f0f0f0;
}

.btn-secondary {
    background: #fafafa;
}

/* =========================
   ADD TO CART
   ========================= */
.btn-add-to-cart {
    width: 100%;
}

.btn-add-to-cart.icon-cart {
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem !important;
}

.add-to-cart-form.detail .btn-add-to-cart {
    width: auto;
    padding: 0.5rem 0.9rem;
    font-size: 0.95rem;
}

/* =========================
   QUANTITY SELECTOR
   ========================= */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.1s;
}

.qty-btn:hover {
    background-color: #e8e8e8;
    transform: translateY(-1px);
}

.quantity-selector input[type="number"] {
    width: 50px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 5px;
}

/* =========================
   CART PAGE – 2-Spalten-Layout
   ========================= */
.cart-page {
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}
.cart-page-title {
    margin: 1.5rem 0 1.2rem;
}

/* =========================
   LEERER WARENKORB
   ========================= */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    max-width: 460px;
    margin: 2rem auto 3rem;
    padding: 3rem 2rem;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.cart-empty-icon {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #94a3b8;
    margin-bottom: 1.4rem;
}
.cart-empty-title {
    font-size: 1.35rem;
    color: #111827;
    margin: 0 0 0.6rem;
}
.cart-empty-text {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 1.6rem;
}
.cart-empty-btn {
    padding: 0.7rem 1.6rem;
    font-size: 1rem;
    border-radius: 9px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.cart-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Eine Karte = ein sauberes Raster:
   Bild | Info (dehnt sich) | Menge | Summe | Entfernen */
.cart-card {
    display: grid;
    grid-template-columns: 84px 1fr auto auto 32px;
    align-items: center;
    gap: 1.2rem;

    padding: 1.1rem 1.3rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}
.cart-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.cart-card-img img {
    width: 84px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #f3f4f6;
    display: block;
}

.cart-card-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.cart-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    text-decoration: none;
    line-height: 1.3;
}
.cart-card-name:hover {
    color: #2563eb;
}
.cart-card-sub {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.cart-card-price {
    font-size: 0.9rem;
    color: #4b5563;
}
.cart-card-sku {
    font-size: 0.82rem;
    color: #9ca3af;
}

/* Menge – Label oben, Feld darunter, mittig */
.cart-card-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}
.cart-card-qty label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.cart-card-qty input,
.cart-quantity {
    width: 64px;
    padding: 0.4rem 0.3rem;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1f2933;
    background: #fff;
}
.cart-card-qty input:focus,
.cart-quantity:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Zeilensumme – rechtsbündig, kräftig */
.cart-card-sum {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    text-align: right;
    white-space: nowrap;
    min-width: 80px;
}

/* Entfernen – dezentes X in eigener Spalte */
.btn-remove-cart {
    background: none;
    border: none;
    color: #c0c4cc;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.15s;
}
.btn-remove-cart:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* =========================
   SUMMARY – Sidebar rechts
   ========================= */
.cart-summary-side {
    position: sticky;
    top: 1.5rem;
}
.cart-summary-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.3rem;
}
.cart-summary-title {
    font-size: 1.05rem;
    margin: 0 0 1rem;
    color: #111827;
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    color: #4b5563;
    padding: 0.35rem 0;
}
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 0.7rem;
    padding-top: 0.9rem;
    border-top: 2px solid #e5e7eb;
    font-size: 1rem;
    color: #111827;
}
.cart-summary-total small {
    font-weight: 400;
    color: #9ca3af;
    font-size: 0.78rem;
}
.cart-summary-total strong {
    font-size: 1.3rem;
    color: #111827;
}
.cart-checkout-btn {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.7rem;
    font-size: 1rem;
    border-radius: 9px;
}
.cart-continue-btn {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.6rem;
    font-size: 0.9rem;
    border-radius: 9px;
}


/* =========================
   MINI CART
   ========================= */
.cart-link {
    position: relative;
}

.mini-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 999;

    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.cart-link:hover .mini-cart-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mini-cart {
    max-height: 460px;
    overflow-y: auto;
}

/* Kopfzeile im Karten-Stil (wie der Mietservice-Warenkorb) */
.mini-cart-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.7rem 1rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2933;
}

.mini-cart-empty {
    padding: 1.6rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}
.mini-cart-empty .btn-secondary {
    display: inline-block;
    margin-top: 0.7rem;
}

.mini-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Eine Position = eine ruhige Zeile mit Bild, Info, Preis */
.mini-cart-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.mini-cart-item:last-child {
    border-bottom: none;
}

.mini-cart-img img {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    background: #f3f4f6;
}

.mini-cart-info {
    flex: 1;
    min-width: 0;            /* erlaubt Umbruch/Ellipsis */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mini-cart-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #111827;
    text-decoration: none;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mini-cart-name:hover {
    color: #2563eb;
}

.mini-cart-meta {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Menge (editierbar) + Einzelpreis dezent wie "3 Stück · 12,00 €" */
.mini-cart-qtybox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.mini-cart-quantity {
    width: 46px;
    padding: 0.15rem 0.3rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
    color: #1f2933;
    background: #fff;
}
.mini-cart-quantity:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.mini-cart-qty-x {
    color: #9ca3af;
}
.mini-cart-unit {
    color: #6b7280;
}

/* Rechte Spalte: Zeilensumme + Entfernen */
.mini-cart-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    white-space: nowrap;
}
.mini-cart-price {
    font-weight: 700;
    font-size: 0.9rem;
    color: #111827;
}
.btn-remove-cart {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.1rem;
    transition: color 0.15s;
}
.btn-remove-cart:hover {
    color: #dc2626;
}

/* Fußzeile: Summe + Aktionen */
.mini-cart-footer {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}
.mini-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.75rem;
}
.mini-cart-total-row strong {
    font-size: 1.05rem;
    color: #111827;
}
.mini-cart-actions {
    display: flex;
    gap: 0.5rem;
}
.mini-cart-actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* =========================
   TOAST
   ========================= */
.cart-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: #fff;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.cart-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   📱 RESPONSIVE
   ========================= */
@media (max-width: 900px) {
    /* Sidebar unter die Artikel schieben */
    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-summary-side {
        position: static;
    }
}

@media (max-width: 600px) {
    /* Karte umbrechen: Bild + Info oben, Menge/Summe/X darunter */
    .cart-card {
        grid-template-columns: 64px 1fr auto;
        grid-template-areas:
            "img info x"
            "img qty sum";
        gap: 0.5rem 0.9rem;
    }
    .cart-card-img  { grid-area: img; }
    .cart-card-info { grid-area: info; }
    .cart-card-qty  { grid-area: qty; align-items: flex-start; }
    .cart-card-sum  { grid-area: sum; align-self: center; }
    .btn-remove-cart { grid-area: x; justify-self: end; }
    .cart-card-img img {
        width: 64px;
        height: 64px;
    }
}
