/**
 * @package MageB2B_B2BQuote
 * @author SoftwareSilo LLC <info@softwaresilo.io>
 * @copyright SoftwareSilo LLC
 * @license https://www.mageb2b.de/en/license-terms
 *
 * Mini Quote Dropdown Styles - Aligned with Luma Minicart
 */

/* ========================================
 * Container in header (next to minicart)
 * Matching minicart-wrapper positioning
 * ======================================== */
.header.content .block-mini-quote {
    float: right;
    margin-left: 13px;
}

.block-mini-quote {
    display: inline-block;
}

.mini-quote-wrapper {
    position: relative;
    display: inline-block;
}

/* ========================================
 * Toggle Button - Matching minicart .action.showcart
 * ======================================== */
.action.mini-quote-toggle {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    white-space: nowrap;
}

.action.mini-quote-toggle:hover {
    text-decoration: none;
}

.action.mini-quote-toggle:focus {
    outline: none;
}

/* Document/Quote Icon - matching minicart icon size (22px icon, 28px line-height) */
.mini-quote-icon {
    display: inline-block;
    width: 22px;
    height: 28px;
    line-height: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10 9 9 9 8 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 22px 22px;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

.action.mini-quote-toggle:hover .mini-quote-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23006bb4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10 9 9 9 8 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Text label - visually hidden like minicart */
.action.mini-quote-toggle .text {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* ========================================
 * Counter Badge - MATCHING minicart exactly
 * Same as .minicart-wrapper .action.showcart .counter.qty
 * ======================================== */
.action.mini-quote-toggle .counter.qty {
    background: #1979c3;
    color: #fff;
    height: 24px;
    line-height: 24px;
    border-radius: 2px;
    display: inline-block;
    margin: 3px 0 0;
    min-width: 18px;
    overflow: hidden;
    padding: 0 3px;
    text-align: center;
    white-space: normal;
    vertical-align: top;
}

.action.mini-quote-toggle .counter.qty.empty {
    display: none;
}

.action.mini-quote-toggle .counter-number {
    text-shadow: 0 0 7px rgba(0, 0, 0, 1);
}

.action.mini-quote-toggle .counter-label {
    border: 0;
    clip: rect(0, 0, 0, 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* ========================================
 * Dropdown Panel
 * ======================================== */
.mini-quote-dropdown {
    display: block !important;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 101;
    min-width: 320px;
    max-width: 380px;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #bbb;
    box-shadow: 0 3px 3px rgba(0, 0, 0, 0.15);
}

/* Dropdown Arrow - matching minicart */
.mini-quote-dropdown:before {
    content: '';
    position: absolute;
    top: -12px;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #bbb;
}

.mini-quote-dropdown:after {
    content: '';
    position: absolute;
    top: -11px;
    right: 11px;
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-bottom: 11px solid #fff;
}

/* ========================================
 * Dropdown Header
 * ======================================== */
.mini-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e5e5e5;
    background: #f5f5f5;
}

.mini-quote-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mini-quote-header .action.close {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #8f8f8f;
    font-size: 12px;
    transition: color 0.2s ease;
}

.mini-quote-header .action.close:hover {
    color: #006bb4;
}

/* ========================================
 * Content Area
 * ======================================== */
.mini-quote-content {
    max-height: 350px;
    overflow-y: auto;
}

/* ========================================
 * Quotes List
 * ======================================== */
.mini-quote-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mini-quote-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.15s ease;
}

.mini-quote-item:last-child {
    border-bottom: none;
}

.mini-quote-item:hover {
    background-color: #f5f5f5;
}

/* Quote Link - entire row clickable */
.mini-quote-item .quote-link {
    display: block;
    flex: 1;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
}

.mini-quote-item .quote-link:hover {
    text-decoration: none;
}

/* Quote Info */
.mini-quote-item .quote-info {
    flex: 1;
}

.mini-quote-item .quote-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.mini-quote-item .quote-increment {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Status Badges */
.mini-quote-item .quote-status {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    line-height: 1.4;
}

/* Status colors are set dynamically via inline style from admin config */
.mini-quote-item .quote-status {
    background-color: #6c757d;
    color: #fff;
}

/* Override when dynamic color is applied via Knockout style binding */
.mini-quote-item .quote-status[style*="background"] {
    color: #fff;
}

/* Quote Details */
.mini-quote-item .quote-details {
    margin-top: 2px;
}

.mini-quote-item .quote-item-count {
    font-size: 12px;
    color: #666;
}

/* Quote Total */
.mini-quote-item .quote-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.mini-quote-item .quote-total-label {
    font-size: 12px;
    color: #666;
}

.mini-quote-item .quote-total {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-left: 0;
}

/* ========================================
 * Delete Button (using Magento icon font like minicart)
 * ======================================== */
.mini-quote-item .action.delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    margin-right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 28px;
    text-align: center;
    overflow: visible;
    position: relative;
}

.mini-quote-item .action.delete:before {
    font-family: 'luma-icons';
    content: '\e604';
    font-size: 18px;
    line-height: 28px;
    color: #8f8f8f;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
}

.mini-quote-item .action.delete:hover:before {
    color: #006bb4;
}

.mini-quote-item .action.delete:focus {
    outline: 2px solid #1979c3;
    outline-offset: 2px;
}

.mini-quote-item .action.delete .delete-icon {
    display: none;
}

/* ========================================
 * Empty State
 * ======================================== */
.mini-quote-empty {
    padding: 30px 15px;
    text-align: center;
    color: #666;
}

.mini-quote-empty p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
 * Footer with View All Link
 * ======================================== */
.mini-quote-footer {
    padding: 12px 15px;
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.mini-quote-footer .action.primary.view-all {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #1979c3;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.mini-quote-footer .action.primary.view-all:hover {
    background: #006bb4;
    text-decoration: none;
}

/* ========================================
 * Responsive Styles
 * ======================================== */
@media (max-width: 767px) {
    .mini-quote-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        margin-top: 0;
        border-radius: 10px 10px 0 0;
        max-height: 70vh;
    }

    .mini-quote-dropdown:before,
    .mini-quote-dropdown:after {
        display: none;
    }

    .mini-quote-content {
        max-height: calc(70vh - 120px);
    }
}

/* Desktop - match minicart spacing */
@media (min-width: 768px) {
    .header.content .block-mini-quote {
        margin-left: 13px;
    }

    .mini-quote-dropdown {
        width: 320px;
    }
}

/* ========================================
 * Animation
 * ======================================== */
@keyframes miniQuoteFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mini-quote-dropdown {
    animation: miniQuoteFadeIn 0.2s ease-out;
}

/* ========================================
 * Print styles
 * ======================================== */
@media print {
    .block-mini-quote,
    .mini-quote-wrapper {
        display: none;
    }
}
