/* ========================================
   SER Custom Mini Cart - CSS Styles - AKTUALISIERTE VERSION
   ======================================== */

:root {
    --ser-primary-color: #4BCFAF;
    --ser-secondary-color: #68E5C0;
    --ser-danger-color: #dc3545;
    --ser-dark-color: #333333;
    --ser-light-color: #f8f9fa;
    --ser-border-color: #dee2e6;
    --ser-text-color: #212529;
    --ser-text-muted: #6c757d;
    --ser-transition: all 0.3s ease;
    --ser-border-radius: 8px;
    --ser-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --ser-z-overlay: 9998;
    --ser-z-sidebar: 9999;
}

/* ================================
   MINI CART TRIGGER ICON
   ================================ */

.ser-mini-cart-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--ser-transition);
    user-select: none;
    text-decoration: none;
    color: inherit;
}

.ser-mini-cart-trigger:hover {
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.ser-mini-cart-trigger:focus {
    outline: 2px solid var(--ser-primary-color);
    outline-offset: 2px;
}

/* Cart Icon Container */
.ser-cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ser-transition);
}

.ser-cart-icon svg {
    display: block;
    transition: var(--ser-transition);
}

/* Cart Count Badge */
.ser-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background-color: var(--ser-primary-color);
    color: white;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    z-index: 10;
    transition: var(--ser-transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ser-cart-count[data-count="0"] {
    display: none;
}

.ser-cart-count.ser-animate-pulse {
    animation: serPulse 0.6s ease-in-out;
}

/* Cart Total Display */
.ser-cart-total {
    font-weight: 600;
    margin-left: 8px;
    transition: var(--ser-transition);
}

/* Icon Sizes */
.ser-icon-small .ser-cart-icon svg {
    width: 18px;
    height: 18px;
}

.ser-icon-small .ser-cart-count {
    width: 14px;
    height: 14px;
    font-size: 10px;
    top: -6px;
    right: -6px;
}

.ser-icon-medium .ser-cart-icon svg {
    width: 24px;
    height: 24px;
}

.ser-icon-medium .ser-cart-count {
    width: 18px;
    height: 18px;
    font-size: 12px;
    top: -8px;
    right: -8px;
}

.ser-icon-large .ser-cart-icon svg {
    width: 32px;
    height: 32px;
}

.ser-icon-large .ser-cart-count {
    width: 22px;
    height: 22px;
    font-size: 14px;
    top: -10px;
    right: -10px;
}

/* Layout Variations */
.ser-layout-vertical {
    flex-direction: column;
    gap: 4px;
}

.ser-layout-vertical .ser-cart-total {
    margin-left: 0;
    font-size: 0.875em;
}

/* ================================
   OVERLAY
   ================================ */

.ser-mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--ser-z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ser-mini-cart-overlay.ser-active {
    opacity: 1;
    visibility: visible;
}

/* ================================
   MINI CART SIDEBAR - DYNAMISCHE HÖHE
   ================================ */

.ser-mini-cart-sidebar {
    position: fixed;
    top: 0;
    width: 400px;
    max-width: 90vw;
    height: auto;
    min-height: 300px;
    max-height: 90vh;
    background: white;
    box-shadow: var(--ser-box-shadow);
    z-index: var(--ser-z-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    border-radius: 12px 0 0 12px;
}

/* Slide Directions - ANGEPASST FÜR DYNAMISCHE HÖHE */
.ser-mini-cart-sidebar.ser-slide-right {
    right: 20px;
    top: 20px;
    transform: translateX(100%);
}

.ser-mini-cart-sidebar.ser-slide-left {
    left: 20px;
    top: 20px;
    transform: translateX(-100%);
}

.ser-mini-cart-sidebar.ser-active {
    transform: translateX(0);
}

/* ================================
   MINI CART HEADER
   ================================ */

.ser-mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ser-border-color);
    background: var(--ser-light-color);
    flex-shrink: 0;
}

.ser-mini-cart-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ser-dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ser-mini-cart-count-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--ser-primary-color);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 12px;
}

/* Schlichter Close-Button ohne Umrandung */
.ser-mini-cart-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto; /* Keine feste Breite */
    height: auto; /* Keine feste Höhe */
    background: none; /* Kein Hintergrund */
    border: none; /* Keine Umrandung */
    color: #dc3545; /* Rote Farbe wie Remove-Buttons */
    cursor: pointer;
    border-radius: 50%; /* Keine Rundung */
    transition: var(--ser-transition);
    font-size: 18px; /* Etwas größer da es der Haupt-Close-Button ist */
    font-weight: 700;
    line-height: 1;
    padding: 2px; /* Minimales Padding für Klickbereich */
}

.ser-mini-cart-close:hover {
    background: none; /* Kein Hintergrund beim Hover */
    color: #a71e2a; /* Dunkleres Rot beim Hover */
    transform: scale(0.9); /* Leichte Vergrößerung beim Hover */
}

.ser-mini-cart-close:focus {
    outline: 1px dotted #dc3545; /* Dezente Fokus-Umrandung */
    outline-offset: 1px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .ser-mini-cart-close {
        font-size: 16px;
        padding: 3px;
    }
}

@media (max-width: 480px) {
    .ser-mini-cart-close {
        font-size: 14px;
        padding: 2px;
    }
}

/* ================================
   MINI CART CONTENT
   ================================ */

.ser-mini-cart-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ser-mini-cart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.ser-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--ser-border-color);
    border-top: 3px solid var(--ser-primary-color);
    border-radius: 50%;
    animation: serSpin 1s linear infinite;
}

.ser-mini-cart-items-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: 60vh;
}

/* VERBESSERTE SCROLLBAR */
.ser-mini-cart-items-container::-webkit-scrollbar {
    width: 8px;
}

.ser-mini-cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ser-mini-cart-items-container::-webkit-scrollbar-thumb {
    background: var(--ser-primary-color);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.ser-mini-cart-items-container::-webkit-scrollbar-thumb:hover {
    background: var(--ser-secondary-color);
}

/* Firefox Scrollbar */
.ser-mini-cart-items-container {
    scrollbar-width: thin;
    scrollbar-color: var(--ser-primary-color) #f1f1f1;
}

/* ================================
   CART ITEMS - VERBESSERTE ANORDNUNG
   ================================ */

.ser-cart-items {
    padding: 8px 0;
}

.ser-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--ser-border-color);
    transition: var(--ser-transition);
    position: relative;
    flex-direction: row; /* Sicherstellen dass es horizontal bleibt */
}

.ser-cart-item:last-child {
    border-bottom: none;
}

.ser-cart-item:hover {
    background: var(--ser-light-color);
}

/* Product Image */
.ser-item-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: var(--ser-border-radius);
    overflow: hidden;
    background: var(--ser-light-color);
    border: 1px solid var(--ser-border-color);
}

.ser-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Item Details nimmt den Hauptbereich ein */
.ser-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ser-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--ser-dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Cannabis Info - KOMPAKTER */
.ser-cannabis-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ser-product-id {
    font-size: 0.7rem;
    color: var(--ser-text-muted);
    font-weight: 500;
    margin: 0;
}

.ser-cannabinoids {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}

.ser-thc-badge,
.ser-cbd-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 8px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.ser-thc-badge {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #d63031;
    border: 1px solid #fdcb6e;
}

.ser-cbd-badge {
    background: linear-gradient(135deg, #d1f2eb 0%, #a8e6cf 100%);
    color: #00b894;
    border: 1px solid #a8e6cf;
}

/* Fee Info - KOMPAKTER */
.ser-fee-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ser-fee-id {
    font-size: 0.7rem;
    color: var(--ser-text-muted);
    font-weight: 500;
    margin: 0;
}

.ser-fee-service {
    display: flex;
    align-items: center;
}

.ser-fee-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%);
    color: #0277bd;
    border: 1px solid #b3e5fc;
    border-radius: 8px;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* ================================
   QUANTITY CONTROLS - AKTUALISIERTE KLEINERE BUTTONS
   ================================ */

/* Quantity Controls - KLEINERE RUNDE BUTTONS */
.ser-quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    justify-content: flex-start; /* Links ausrichten */
}

/* Schlichte Plus/Minus-Buttons ohne Umrandung */
.ser-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto; /* Keine feste Breite */
    height: auto; /* Keine feste Höhe */
    background: none; /* Kein Hintergrund */
    color: var(--ser-primary-color); /* Türkise Farbe */
    border: none; /* Keine Umrandung */
    border-radius: 0; /* Keine Rundung */
    font-size: 12px; /* Größere Schrift für bessere Sichtbarkeit */
    font-weight: 700;
    cursor: pointer;
    transition: var(--ser-transition);
    user-select: none;
    line-height: 1;
    flex-shrink: 0;
    padding: 2px 2px; /* Minimales Padding für Klickbereich */
}

.ser-qty-btn:hover:not(:disabled) {
    background: none; /* Kein Hintergrund beim Hover */
    color: var(--ser-secondary-color); /* Helleres Türkis beim Hover */
    transform: scale(0.9); /* Leichte Vergrößerung beim Hover */
}

.ser-qty-btn:disabled {
    background: none; /* Kein Hintergrund */
    color: #ccc; /* Graue Farbe für deaktiviert */
    cursor: not-allowed;
    transform: none;
}

.ser-qty-btn:focus {
    outline: 1px dotted var(--ser-primary-color); /* Dezente Fokus-Umrandung */
    outline-offset: 1px;
}

.ser-qty-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ser-dark-color);
    min-width: 30px;
    text-align: center;
    flex-shrink: 0; /* Verhindert Schrumpfen */
}

/* Normale Mengenanzeige für Bearbeitungsgebühren */
.ser-item-quantity {
    font-size: 0.7rem;
    color: var(--ser-text-muted);
    margin: 4px 0 0 0;
    padding: 0;
    line-height: 1.2;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .ser-qty-btn {
        font-size: 16px;
        padding: 3px 5px;
    }
}

@media (max-width: 480px) {
    .ser-qty-btn {
        font-size: 14px;
        padding: 2px 4px;
    }
}

/* ================================
   CANNABIS SPEZIFISCHE ANPASSUNGEN
   ================================ */

/* Cannabis-Produkte: Nur Quantity Controls, keine zusätzliche Mengenanzeige */
.ser-cart-item .ser-cannabis-info + .ser-quantity-controls {
    margin-top: 6px;
}

/* Bearbeitungsgebühren: Nur Mengentext, keine Controls */
.ser-cart-item .ser-fee-info + .ser-item-quantity {
    margin-top: 6px;
    font-style: italic;
}

/* ================================
   ITEM PRICE SECTION - AKTUALISIERTES LAYOUT
   ================================ */

/* Price Section bleibt im Details-Bereich */
.ser-item-price-section {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.ser-cannabis-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    transition: all 0.3s ease; /* Smooth updates */
}

.ser-cannabis-price[data-updating="true"] {
    opacity: 0.7;
}

.ser-price-breakdown {
    font-size: 0.7rem;
    color: var(--ser-text-muted);
    line-height: 1.1;
    transition: all 0.3s ease;
}

/* Apothekenpreis: schwarzer Text, aber grüner Hintergrund bleibt */
.ser-pharmacy-total,
.ser-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333333 !important; /* Schwarzer Text */
    line-height: 1.1;
    transition: all 0.3s ease;
    background-color: var(--ser-primary-color) !important; /* Grüner Hintergrund bleibt */
    padding: 4px 8px !important; /* Padding für Hintergrund */
    border-radius: 4px !important; /* Abgerundete Ecken */
}

/* Entferne unterschiedliche Styling zwischen den Preisen */
.ser-pharmacy-total {
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

/* Stelle sicher dass beide Preise gleich aussehen */
.ser-item-price-section .ser-price,
.ser-item-price-section .ser-pharmacy-total {
    font-family: inherit !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #333333 !important;
    line-height: 1.1 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

.ser-price-note {
    font-size: 0.55rem;
    color: var(--ser-dark-color);
    font-style: italic;
    line-height: 1.1;
}

.ser-price {
    font-weight: 600;
    color: var(--ser-dark-color);
    font-size: 0.8rem;
}

/* Einfache Trennlinie zwischen Produkten ohne grünen Balken */
.ser-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px; /* Etwas mehr Padding für besseren Abstand */
    border-bottom: 1px solid #e8e8e8; /* Hellgraue Trennlinie */
    transition: var(--ser-transition);
    position: relative;
    flex-direction: row;
}

/* Letztes Item hat keine Trennlinie */
.ser-cart-item:last-child {
    border-bottom: none;
}

/* Hover-Effekt für bessere Interaktion */
.ser-cart-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    transform: translateX(2px);
}

/* ================================
   TAX NOTES STYLING - NEU
   ================================ */

.ser-tax-note {
    font-size: 0.6rem;
    color: var(--ser-text-muted);
    font-weight: normal;
    vertical-align: super;
    line-height: 1;
    margin-left: 1px;
}

/* ================================
   REMOVE BUTTON - AKTUALISIERTE POSITION UND GRÖSSE
   ================================ */

/* Remove Button auf Höhe des Preises positionieren */
.ser-item-remove {
    position: absolute;
    top: auto; /* Entferne top positioning */
    bottom: 16px; /* Positioniere vom unteren Rand des Items */
    right: 20px;
    align-self: auto; /* Entferne flex-end */
    margin: 0; /* Entferne margins */
}

/* Schlichtes rotes X ohne Umrandung */
.ser-remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto; /* Keine feste Breite */
    height: auto; /* Keine feste Höhe */
    background: none; /* Kein Hintergrund */
    border: none; /* Keine Umrandung */
    color: #dc3545; /* Rote Farbe */
    cursor: pointer;
    border-radius: 50%; /* Keine Rundung */
    transition: var(--ser-transition);
    font-size: 12px; /* Größere Schrift für bessere Sichtbarkeit */
    font-weight: 700; /* Fett für bessere Sichtbarkeit */
    line-height: 1;
    padding: 2px; /* Nur minimales Padding für Klickbereich */
}

.ser-remove-item:hover {
    background: none; /* Kein Hintergrund beim Hover */
    color: #a71e2a; /* Dunkleres Rot beim Hover */
    transform: scale(0.9); /* Leichte Vergrößerung beim Hover */
}

.ser-remove-item:focus {
    outline: 1px dotted #dc3545; /* Dezente Fokus-Umrandung für Accessibility */
    outline-offset: 1px;
}

/* Alternative: Falls der Preis eine spezifische Höhe hat */
.ser-cart-item {
    position: relative; /* Stelle sicher dass das parent relative ist */
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .ser-item-remove {
        bottom: 12px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .ser-item-remove {
        bottom: 10px;
        right: 12px;
    }
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .ser-remove-item {
        font-size: 14px;
        padding: 3px;
    }
}

@media (max-width: 480px) {
    .ser-remove-item {
        font-size: 12px;
        padding: 2px;
    }
}

/* ================================
   EMPTY CART
   ================================ */

.ser-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--ser-text-muted);
}

.ser-empty-cart-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.ser-empty-cart-icon svg {
    width: 100%;
    height: 100%;
    color: var(--ser-text-muted);
}

.ser-empty-cart h4 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ser-dark-color);
}

.ser-empty-cart p {
    margin: 0 0 20px 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ================================
   MINI CART FOOTER
   ================================ */

.ser-mini-cart-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--ser-border-color);
    background: white;
}

/* Cart Totals */
.ser-cart-totals {
    padding: 16px 24px;
}

.ser-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ser-total-row:last-child {
    margin-bottom: 0;
}

.ser-total-label {
    font-size: 0.875rem;
    color: var(--ser-text-color);
}

.ser-total-amount {
    font-weight: 600;
    color: var(--ser-dark-color);
}

.ser-pharmacy-total-row .ser-total-label,
.ser-pharmacy-total-row .ser-total-amount {
    color: #333333 !important; /* Schwarzer Text */
    font-weight: 600;
    background-color: var(--ser-primary-color) !important; /* Grüner Hintergrund */
    padding: 4px 8px !important; /* Padding für Hintergrund */
    border-radius: 4px !important; /* Abgerundete Ecken */
}

.ser-payment-total-row {
    padding-top: 8px;
    border-top: 1px solid var(--ser-border-color);
    margin-top: 8px;
}

.ser-payment-total-row .ser-total-label,
.ser-payment-total-row .ser-total-amount {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ser-dark-color);
}

/* ================================
   TOTAL NOTES STYLING - AKTUALISIERT
   ================================ */

.ser-total-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ser-border-color);
}

.ser-total-note small {
    font-size: 0.7rem;
    color: var(--ser-text-muted);
    line-height: 1.5;
    display: block;
}

.ser-total-note strong {
    color: var(--ser-dark-color);
    font-weight: 600;
}

/* Action Buttons */
.ser-mini-cart-actions {
    padding: 16px 24px;
    display: flex;
    gap: 12px;
}

.ser-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--ser-border-radius);
    cursor: pointer;
    transition: var(--ser-transition);
    flex: 1;
    text-align: center;
    min-height: 44px;
}

.ser-btn:focus {
    outline: 2px solid;
    outline-offset: 2px;
}

.ser-btn-primary {
    background: linear-gradient(135deg, var(--ser-primary-color) 0%, var(--ser-secondary-color) 100%);
    color: white;
}

.ser-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(75, 207, 175, 0.3);
    text-decoration: none;
    color: white;
}

.ser-btn-primary:focus {
    outline-color: var(--ser-primary-color);
}

.ser-btn-secondary {
    background: white;
    color: var(--ser-dark-color);
    border: 2px solid var(--ser-border-color);
}

.ser-btn-secondary:hover {
    background: var(--ser-light-color);
    border-color: var(--ser-primary-color);
    text-decoration: none;
    color: var(--ser-dark-color);
}

.ser-btn-secondary:focus {
    outline-color: var(--ser-primary-color);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes serSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes serPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes serFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes serSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Animation Classes */
.ser-animate-fade-in {
    animation: serFadeIn 0.3s ease-out;
}

.ser-animate-slide-in {
    animation: serSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ================================
   LOADING STATES FÜR PRICE UPDATES - NEU
   ================================ */

.ser-cannabis-price.ser-updating {
    position: relative;
}

.ser-cannabis-price.ser-updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    animation: serPulse 1s ease-in-out infinite;
}

/* ================================
   UPDATED RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .ser-mini-cart-sidebar {
        width: 320px;
        max-width: 95vw;
    }
    
    .ser-mini-cart-header {
        padding: 16px 20px;
    }
    
    .ser-mini-cart-title {
        font-size: 1.125rem;
    }
    
    .ser-cart-item {
        padding: 10px 16px;
        gap: 8px;
    }
    
    .ser-item-image {
        width: 40px;
        height: 40px;
    }
    
    .ser-item-name {
        font-size: 0.8125rem;
    }
    
    .ser-quantity-controls {
        gap: 6px;
        margin-top: 6px;
    }
    
    .ser-qty-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .ser-qty-display {
        font-size: 0.75rem;
        min-width: 25px;
    }
    
    .ser-item-quantity {
        font-size: 0.65rem;
    }
    
    .ser-remove-item {
        width: 14px;
        height: 14px;
        font-size: 10px;
        margin-top: 6px;
        margin-left: 6px;
    }
    
    .ser-mini-cart-close {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
    
    .ser-cart-totals,
    .ser-mini-cart-actions {
        padding: 12px 20px;
    }
    
    .ser-mini-cart-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .ser-btn {
        padding: 10px 16px;
        font-size: 0.8125rem;
    }
    
    .ser-empty-cart {
        padding: 40px 20px;
    }
    
    .ser-empty-cart-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .ser-mini-cart-sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .ser-cart-item {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .ser-item-image {
        width: 35px;
        height: 35px;
    }
    
    .ser-cannabinoids {
        gap: 2px;
    }
    
    .ser-thc-badge,
    .ser-cbd-badge,
    .ser-fee-badge {
        font-size: 0.5rem;
        padding: 1px 3px;
    }
    
    .ser-quantity-controls {
        gap: 4px;
    }
    
    .ser-qty-btn {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .ser-qty-display {
        font-size: 0.7rem;
        min-width: 22px;
    }
    
    .ser-remove-item {
        width: 12px;
        height: 12px;
        font-size: 9px;
    }
    
    .ser-mini-cart-close {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
    
    .ser-item-price-section {
        font-size: 0.7rem;
    }
    
    .ser-price-breakdown,
    .ser-pharmacy-total,
    .ser-price-note {
        font-size: 0.6rem;
    }
    
    .ser-tax-note {
        font-size: 0.5rem;
    }
}

/* ================================
   BUTTON FOCUS STATES - AKTUALISIERT
   ================================ */

.ser-qty-btn:focus,
.ser-remove-item:focus,
.ser-mini-cart-close:focus {
    outline: 2px solid var(--ser-primary-color);
    outline-offset: 2px;
    z-index: 10;
}

/* ================================
   HIGH CONTRAST MODE
   ================================ */

@media (prefers-contrast: high) {
    .ser-cart-count {
        border: 2px solid white;
    }
    
    .ser-btn-primary {
        background: var(--ser-primary-color);
        border: 2px solid var(--ser-primary-color);
    }
    
    .ser-btn-secondary {
        border-width: 3px;
    }
    
    .ser-qty-btn {
        border: 2px solid white;
    }
}

/* ================================
   REDUCED MOTION
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .ser-mini-cart-trigger,
    .ser-cart-icon,
    .ser-cart-count,
    .ser-qty-btn,
    .ser-btn,
    .ser-mini-cart-sidebar,
    .ser-mini-cart-overlay {
        transition: none;
    }
    
    .ser-loading-spinner {
        animation: none;
    }
    
    .ser-cart-count.ser-animate-pulse {
        animation: none;
    }
    
    .ser-animate-fade-in,
    .ser-animate-slide-in {
        animation: none;
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .ser-mini-cart-trigger,
    .ser-mini-cart-overlay,
    .ser-mini-cart-sidebar {
        display: none !important;
    }
}

/* ================================
   DARK MODE SUPPORT
   ================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --ser-dark-color: #ffffff;
        --ser-light-color: #1a1a1a;
        --ser-border-color: #333333;
        --ser-text-color: #ffffff;
        --ser-text-muted: #cccccc;
    }
    
    .ser-mini-cart-sidebar {
        background: #2d2d2d;
        color: var(--ser-text-color);
    }
    
    .ser-mini-cart-header {
        background: #1a1a1a;
        border-bottom-color: var(--ser-border-color);
    }
    
    .ser-cart-item:hover {
        background: #333333;
    }
    
    .ser-item-image {
        background: #333333;
    }
    
    .ser-btn-secondary {
        background: #2d2d2d;
        color: var(--ser-text-color);
        border-color: var(--ser-border-color);
    }
    
    .ser-btn-secondary:hover {
        background: #333333;
    }
}

/* ================================
   RTL SUPPORT
   ================================ */

[dir="rtl"] .ser-mini-cart-sidebar.ser-slide-right {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

[dir="rtl"] .ser-mini-cart-sidebar.ser-slide-left {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

[dir="rtl"] .ser-cart-count {
    right: auto;
    left: -8px;
}

[dir="rtl"] .ser-cart-total {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .ser-item-remove {
    margin-left: 0;
    margin-right: 8px;
}

/* ================================
   ELEMENTOR SPECIFIC STYLES
   ================================ */

.elementor-widget-ser-mini-cart-icon .ser-mini-cart-trigger {
    width: 100%;
    justify-content: inherit;
}

.elementor-widget-ser-mini-cart-icon .ser-layout-vertical {
    align-items: inherit;
}

/* ================================
   ACCESSIBILITY IMPROVEMENTS
   ================================ */

.ser-mini-cart-trigger:focus-visible,
.ser-qty-btn:focus-visible,
.ser-remove-item:focus-visible,
.ser-mini-cart-close:focus-visible,
.ser-btn:focus-visible {
    outline: 2px solid var(--ser-primary-color);
    outline-offset: 2px;
}

.ser-screen-reader-text {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* Ensure sufficient color contrast */
.ser-cart-count {
    color: white;
    background-color: var(--ser-primary-color);
}

.ser-thc-badge {
    color: #8b0000; /* Darker red for better contrast */
}

.ser-cbd-badge {
    color: #006400; /* Darker green for better contrast */
}

.ser-fee-badge {
    color: #1565c0; /* Darker blue for better contrast */
}

/* ================================
   LOADING STATES
   ================================ */

.ser-mini-cart-sidebar.ser-loading .ser-mini-cart-content {
    pointer-events: none;
}

.ser-mini-cart-sidebar.ser-loading .ser-cart-items {
    opacity: 0.5;
}

.ser-qty-btn.ser-loading {
    position: relative;
    color: transparent;
}

.ser-qty-btn.ser-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: serSpin 0.8s linear infinite;
    color: white;
}

/* ================================
   ERROR STATES
   ================================ */

.ser-mini-cart-error {
    padding: 20px 24px;
    text-align: center;
    color: var(--ser-danger-color);
}

.ser-mini-cart-error .ser-error-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    color: var(--ser-danger-color);
}

.ser-mini-cart-error h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
}

.ser-mini-cart-error p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* ================================
   SUCCESS STATES
   ================================ */

.ser-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--ser-primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--ser-border-radius);
    box-shadow: var(--ser-box-shadow);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.ser-success-message.ser-show {
    transform: translateX(0);
}

.ser-success-message.ser-hide {
    transform: translateX(100%);
}

/* ================================
   CUSTOM PROPERTIES FOR THEMING
   ================================ */

.ser-mini-cart-sidebar {
    --primary-color: var(--ser-primary-color);
}

.ser-mini-cart-sidebar[style*="--primary-color"] {
    --ser-primary-color: var(--primary-color);
}

/* Apply custom primary color to relevant elements */
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-cart-count,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-mini-cart-count-header,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-qty-btn,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-pharmacy-total,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-pharmacy-total-row .ser-total-label,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-pharmacy-total-row .ser-total-amount {
    background-color: var(--primary-color) !important; /* Grüner Hintergrund */
    color: #333333 !important; /* Schwarzer Text */
}

.ser-mini-cart-sidebar[style*="--primary-color"] .ser-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color) 100%);
}

.ser-mini-cart-sidebar[style*="--primary-color"] .ser-btn-secondary:hover {
    border-color: var(--primary-color);
}

.ser-mini-cart-sidebar[style*="--primary-color"] .ser-mini-cart-close:focus,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-qty-btn:focus,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-remove-item:focus,
.ser-mini-cart-sidebar[style*="--primary-color"] .ser-btn:focus {
    outline-color: var(--primary-color);
}

/* ================================
   SPECIAL FIXES FOR CANNABIS PRODUCTS
   ================================ */

/* Verstecke body scroll wenn Mini Cart offen ist */
body.ser-mini-cart-open {
    overflow: hidden;
}

/* Zusätzliche Sicherheit für Cannabis-Preise */
.ser-cart-item .ser-cannabis-price .ser-pharmacy-total {
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Fee Badge spezielle Behandlung */
.ser-cart-item .ser-fee-info .ser-fee-badge {
    background: linear-gradient(135deg, #e1f5fe 0%, #b3e5fc 100%) !important;
    color: #0277bd !important;
    border: 1px solid #b3e5fc !important;
}

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

.ser-qty-btn,
.ser-remove-item,
.ser-mini-cart-close {
    will-change: transform, background-color;
    backface-visibility: hidden;
}

.ser-mini-cart-sidebar {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ser-cart-item {
    contain: layout;
}

.ser-cannabis-price {
    contain: layout;
}

/* ================================
   BROWSER SPECIFIC FIXES
   ================================ */

/* Firefox */
@-moz-document url-prefix() {
    .ser-qty-btn {
        line-height: 1.2;
    }
}

/* Safari */
@supports (-webkit-appearance: none) {
    .ser-cart-count {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Edge Legacy */
@supports (-ms-ime-align: auto) {
    .ser-mini-cart-sidebar {
        max-height: 85vh;
    }
}

/* ================================
   FINAL OVERRIDES
   ================================ */

/* Stelle sicher dass unsere Styles Priorität haben */
.ser-mini-cart-sidebar .ser-quantity-controls {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ser-mini-cart-sidebar .ser-qty-display {
    font-weight: 600 !important;
    color: var(--ser-dark-color) !important;
}

.ser-mini-cart-sidebar .ser-item-quantity {
    font-size: 0.7rem !important;
    color: var(--ser-text-muted) !important;
    font-style: italic !important;
}

/* Sicherstelle dass Remove Button korrekt positioniert ist */
.ser-mini-cart-sidebar .ser-item-remove {
    align-self: flex-end !important;
    margin-top: 8px !important;
    margin-left: 8px !important;
}
