/**
 * WooCommerce Dropdown Cart Styles
 * Modern Apple-inspired design
 */

/* Container */
.wcdc-container {
    position: relative;
    display: inline-block;
}

/* Trigger Button */
.wcdc-trigger {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1D1D1F;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wcdc-trigger:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.wcdc-trigger.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Icon */
.wcdc-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}

/* Count Badge */
.wcdc-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #007AFF;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
}

/* Total */
.wcdc-total {
    font-weight: 600;
    font-size: 14px;
    margin-left: 4px;
}

/* Dropdown */
.wcdc-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    min-width: 360px;
    max-width: 420px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999;
}

/* iOS Safari Backdrop Support */
@supports (-webkit-backdrop-filter: none) {
    .wcdc-dropdown {
        -webkit-backdrop-filter: blur(30px) saturate(180%);
    }
}

.wcdc-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Arrow */
.wcdc-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.95);
    transform: rotate(45deg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
}

/* Cart Content */
.wcdc-cart-content {
    max-height: 400px;
    overflow-y: auto;
}

.wcdc-cart-content::-webkit-scrollbar {
    width: 6px;
}

.wcdc-cart-content::-webkit-scrollbar-track {
    background: transparent;
}

.wcdc-cart-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Empty Cart */
.wcdc-empty-cart {
    padding: 48px 24px;
    text-align: center;
    color: #86868B;
}

.wcdc-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.wcdc-empty-cart p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* Items */
.wcdc-items {
    padding: 16px 0;
}

.wcdc-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s ease;
    position: relative;
}

.wcdc-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.wcdc-item-image {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #F2F2F7;
}

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

.wcdc-item-details {
    flex: 1;
    min-width: 0;
}

.wcdc-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.wcdc-item-name a {
    color: inherit;
    text-decoration: none;
}

.wcdc-item-name a:hover {
    color: #007AFF;
}

.wcdc-item-meta {
    font-size: 13px;
    color: #86868B;
    display: flex;
    gap: 8px;
    align-items: center;
}

.wcdc-item-price {
    font-weight: 600;
    color: #1D1D1F;
}

/* Remove Button */
.wcdc-remove-item {
    position: absolute;
    top: 12px;
    right: 20px;
    background: transparent;
    border: none;
    color: #86868B;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
}

.wcdc-item:hover .wcdc-remove-item {
    opacity: 1;
}

.wcdc-remove-item:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #FF3B30;
}

.wcdc-remove-item .wcdc-icon {
    width: 14px;
    height: 14px;
}

/* Summary */
.wcdc-summary {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px;
}

.wcdc-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1D1D1F;
}

/* Actions */
.wcdc-actions {
    display: flex;
    gap: 12px;
}

.wcdc-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
}

.wcdc-btn-secondary {
    background: #F2F2F7;
    color: #1D1D1F;
}

.wcdc-btn-secondary:hover {
    background: #E5E5EA;
    transform: translateY(-1px);
}

.wcdc-btn-primary {
    background: #007AFF;
    color: white;
}

.wcdc-btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

.wcdc-btn .wcdc-icon {
    width: 16px;
    height: 16px;
}

/* Loading State */
.wcdc-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    z-index: 10;
}

.wcdc-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-top: 2px solid #007AFF;
    border-radius: 50%;
    animation: wcdc-spin 0.8s linear infinite;
}

@keyframes wcdc-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    /* Mobile: Preis ausblenden aber Container behalten */
    .wcdc-total-amount {
        display: none;
    }
    
    .wcdc-trigger {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .wcdc-total-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .wcdc-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        max-width: none !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(30px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1) !important;
        z-index: 999999 !important;
    }
    
    .wcdc-dropdown::before {
        display: none !important;
    }
    
    .wcdc-dropdown.active {
        transform: translateY(0) !important;
    }
    
    .wcdc-cart-content {
        max-height: 60vh !important;
    }
    
    /* Mobile: Icon und Counter behalten, Preis verstecken */
    .wcdc-total {
        display: none !important;
    }
    
    .wcdc-trigger {
        padding: 8px 10px !important;
    }
}

/* Kompakte Flatrate Info */
.wcdc-flatrate-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 13px;
    padding: 4px 8px;
    background: #F2F2F7;
    border-radius: 6px;
}

.wcdc-flatrate-dates {
    color: #86868B;
    font-weight: 500;
}

.wcdc-flatrate-price {
    color: #007AFF;
    font-weight: 600;
}

/* Verstecke redundante Infos bei Flatrates */
.wcdc-item:has(.wcdc-flatrate-compact) .wcdc-item-price,
.wcdc-item:has(.wcdc-flatrate-compact) .wcdc-item-quantity {
    display: none;
}

/* Titel anpassen - Tage entfernen da redundant */
.wcdc-item-name {
    font-size: 14px;
    line-height: 1.3;
}


/* Flatrate Info */
.wcdc-flatrate-info {
    margin-top: 6px;
}

.wcdc-flatrate-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.wcdc-flatrate-dates {
    font-size: 13px;
    color: #86868B;
}

.wcdc-flatrate-badge {
    background: #007AFF;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wcdc-flatrate-price {
    font-size: 14px;
    font-weight: 600;
    color: #007AFF;
}

/* Normale Produkte behalten ihre Anzeige */
.wcdc-item-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #86868B;
}

/* Flatrate Icon */
.wcdc-flatrate-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.wcdc-flatrate-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
    stroke-width: 1.5;
}

/* Hover Effekt */
.wcdc-item:hover .wcdc-flatrate-icon {
    background: linear-gradient(135deg, #0056CC 0%, #007AFF 100%);
    transform: scale(1.05);
}

/* Smooth transitions */
.wcdc-flatrate-icon {
    transition: all 0.3s ease;
}

.wcdc-item:has(.wcdc-flatrate-info) .wcdc-item-meta {
    display: none !important;
}

/* Credit Icon - exakt wie Flatrate Icon */
.wcdc-credit-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    transition: all 0.3s ease;
}

.wcdc-credit-icon svg {
    width: 36px;
    height: 36px;
    stroke: white;
    stroke-width: 1.5;
}

/* Credit Info - exakt wie Flatrate Info */
.wcdc-credit-info {
    margin-top: 6px;
}

.wcdc-credit-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.wcdc-credit-dates {
    font-size: 13px;
    color: #86868B;
}

.wcdc-credit-badge {
    background: #34C759;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.wcdc-credit-price {
    font-size: 14px;
    font-weight: 600;
    color: #34C759;
}

/* Hover Effekt wie Flatrate */
.wcdc-item:hover .wcdc-credit-icon {
    background: linear-gradient(135deg, #30A653 0%, #34C759 100%);
    transform: scale(1.05);
}

/* Hide meta für Credits */
.wcdc-item:has(.wcdc-credit-info) .wcdc-item-meta {
    display: none !important;
}