/**
 * Warenkorb Dropdown Styles
 * Optimiert für alle modernen Browser
 */

/* ==============================================
   DROPDOWN CONTAINER
   ============================================== */

.dungar-dropdown {
    position: relative;
    display: inline-block;
}

.dungar-dropdown .dungar-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 320px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    
    /* Standardmäßig versteckt */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    
    /* Verhindere Scroll-Probleme */
    max-height: 70vh;
    overflow-y: auto;
}

/* Dropdown geöffnet */
.dungar-dropdown.open .dungar-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* ==============================================
   WARENKORB SPEZIFISCH
   ============================================== */

.block-minicart .dungar-submenu {
    min-width: 400px;
    padding: 20px;
}

.block-minicart .shopcart-description {
    padding: 0;
}

.block-minicart .content-wrap h3.title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Warenkorb leer */
.block-minicart .no-product {
    padding: 30px 20px;
    text-align: center;
}

.block-minicart .no-product .text {
    color: #666;
    font-size: 14px;
}

/* ==============================================
   MINI WARENKORB ITEMS
   ============================================== */

.minicart-items {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    max-height: 400px;
    overflow-y: auto;
}

.minicart-items li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.minicart-items li:last-child {
    border-bottom: none;
}

.minicart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
}

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

.minicart-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.minicart-item-quantity {
    font-size: 13px;
    color: #666;
}

.minicart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-left: 10px;
    white-space: nowrap;
}

.minicart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    margin-left: 10px;
    transition: color 0.2s;
}

.minicart-item-remove:hover {
    color: #e74c3c;
}

/* ==============================================
   SUMME & AKTIONEN
   ============================================== */

.subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin: 10px 0;
    border-top: 2px solid #f0f0f0;
    font-size: 16px;
    font-weight: 600;
}

.total-title {
    color: #333;
}

.total-price {
    color: #27ae60;
    font-size: 18px;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.actions .button {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.button-viewcart {
    background: #f0f0f0;
    color: #333;
}

.button-viewcart:hover {
    background: #e0e0e0;
}

.button-checkout {
    background: #27ae60;
    color: #ffffff;
}

.button-checkout:hover {
    background: #229954;
}

/* ==============================================
   ACCOUNT DROPDOWN
   ============================================== */

.block-account .dungar-submenu {
    min-width: 300px;
    padding: 20px;
}

.header-user-form-tabs .tab-link {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #f0f0f0;
}

.header-user-form-tabs .tab-link li {
    flex: 1;
}

.header-user-form-tabs .tab-link a {
    display: block;
    padding: 10px 15px;
    text-align: center;
    text-decoration: none;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.header-user-form-tabs .tab-link li.active a {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.form-row {
    margin-bottom: 15px;
}

.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.form-row input[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background: #27ae60;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.form-row input[type="submit"]:hover {
    background: #229954;
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 768px) {
    .dungar-dropdown .dungar-submenu,
    .block-minicart .dungar-submenu {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        min-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        transform: translateX(100%);
    }
    
    .dungar-dropdown.open .dungar-submenu {
        transform: translateX(0);
    }
    
    .minicart-items {
        max-height: calc(100vh - 250px);
    }
}

/* ==============================================
   SCROLLBAR STYLING (optional)
   ============================================== */

.minicart-items::-webkit-scrollbar {
    width: 6px;
}

.minicart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.minicart-items::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.minicart-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ==============================================
   WARENKORB ICON MIT BADGE
   ============================================== */

.block-minicart .block-link {
    position: relative;
    display: inline-block;
}

.block-minicart .count-number {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
}
