/**
 * Quote Cart Styles
 * 
 * @package IMS_by_Soul_Country
 */

/* =============================================
   Quote Mini Cart Icon (Header)
   ============================================= */
.ims-quote-mini-cart {
    margin: 0;
    display: flex;
    align-items: center;
}

.ims-quote-mini-cart__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: transparent;
    border: none;
    color: white;
    padding: 8px;
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 8px;
}

.ims-quote-mini-cart__button:hover {
    color: var(--color-cta);
    background: rgba(255, 255, 255, 0.1);
}

.ims-quote-mini-cart__button:active {
    transform: scale(0.95);
}

.ims-quote-mini-cart__icon {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.ims-quote-mini-cart__button:hover .ims-quote-mini-cart__icon {
    transform: scale(1.1);
}

.ims-quote-mini-cart__badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, var(--color-cta), var(--color-gold-accent));
    color: var(--color-dark-charcoal);
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(249, 196, 87, 0.4);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ims-quote-mini-cart__badge.badge-animate {
    animation: badgePop 0.4s ease;
}

@keyframes badgePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.ims-quote-mini-cart__badge.hidden,
.ims-quote-mini-cart__badge[data-count="0"] {
    display: none;
}

/* =============================================
   Quote Cart Page Container
   ============================================= */
.ims-quote-cart-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* =============================================
   Empty Quote Cart
   ============================================= */
.ims-quote-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--color-bg-light);
    border-radius: 8px;
}

.ims-quote-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.ims-quote-empty h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.ims-quote-empty p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* =============================================
   Quote Success Message
   ============================================= */
.ims-quote-success {
    text-align: center;
    padding: 4rem 2rem;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #10b981;
}

.ims-quote-success-icon {
    width: 60px;
    height: 60px;
    background: #10b981;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.ims-quote-success h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 1rem;
}

.ims-quote-success p {
    color: #047857;
    margin-bottom: 0.75rem;
}

/* =============================================
   Quote Cart Main Section
   ============================================= */
.ims-quote-cart h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.ims-quote-intro {
    color: #6b7280;
    margin-bottom: 2rem;
}

/* =============================================
   Quote Items Table
   ============================================= */
.ims-quote-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.ims-quote-items-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--color-bg-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 2px solid var(--color-border);
}

.ims-quote-items-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.ims-quote-items-table tbody tr:hover {
    background: var(--color-bg-light);
}

.ims-quote-items-table td {
    padding: 1rem;
    vertical-align: middle;
}

.ims-quote-items-table .product-thumbnail {
    width: 80px;
}

.ims-quote-items-table .product-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.ims-quote-items-table .product-name {
    font-weight: 500;
}

.ims-quote-items-table .product-name a {
    color: var(--color-dark);
    text-decoration: none;
}

.ims-quote-items-table .product-name a:hover {
    color: var(--color-cta);
}

.ims-quote-items-table .product-sku {
    font-size: 0.875rem;
}

.ims-sku-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-dark);
    background: var(--color-cta);
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
    width: fit-content;
}

.ims-quote-items-table .product-quantity {
    width: 100px;
}

.ims-quote-quantity {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--color-light-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 0.875rem;
}

.ims-quote-quantity:focus {
    outline: none;
    border-color: var(--color-cta);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ims-quote-items-table .product-remove {
    width: 50px;
    text-align: center;
}

.ims-quote-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.ims-quote-remove:hover {
    background: #dc2626;
    color: #fff;
}

/* =============================================
   Quote Form Section
   ============================================= */
.ims-quote-form-section {
    background: var(--color-bg-light);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.ims-quote-form-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1.5rem;
}

.ims-quote-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ims-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ims-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ims-form-field-full {
    grid-column: 1 / -1;
}

.ims-form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.ims-form-field label .required {
    color: #dc2626;
}

.ims-form-field input,
.ims-form-field textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-light-gray);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.ims-form-field input:focus,
.ims-form-field textarea:focus {
    outline: none;
    border-color: var(--color-cta);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ims-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.ims-form-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

/* =============================================
   Buttons
   ============================================= */
.ims-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ims-button-primary {
    background: #374151;
    color: #fff;
}

.ims-button-primary:hover {
    background: var(--color-dark);
}

.ims-button-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ims-button:not(.ims-button-primary) {
    background: var(--color-border);
    color: #374151;
}

.ims-button:not(.ims-button-primary):hover {
    background: var(--color-light-gray);
}

/* =============================================
   Add to Quote Button (Product Cards)
   ============================================= */
.ims-add-to-quote {
    padding: 0.625rem 1.5rem;
    background: transparent;
    color: var(--color-dark);
    border: 1px solid var(--color-dark);
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.ims-add-to-quote:hover {
    background: var(--color-dark);
    color: #ffffff;
}

.ims-add-to-quote.adding {
    background: #6b7280;
    border-color: #6b7280;
    color: #ffffff;
    cursor: wait;
}

.ims-add-to-quote.success {
    background: #34d399;
    border-color: var(--color-dark);
    color: var(--color-dark);
}

.ims-add-to-quote.error {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

/* =============================================
   Quote Cart Mini Badge (Header)
   ============================================= */
.ims-quote-cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-cta);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ims-quote-cart-link:hover {
    background: var(--color-cta);
    color: #fff;
}

.ims-quote-cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #fff;
    color: var(--color-cta);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
}

.ims-quote-cart-badge:empty,
.ims-quote-cart-badge[data-count="0"] {
    display: none;
}

/* =============================================
   Responsive Styles
   ============================================= */
@media (max-width: 768px) {
    .ims-quote-cart-container {
        padding: 1rem;
    }
    
    .ims-form-row {
        grid-template-columns: 1fr;
    }
    
    .ims-quote-items-table {
        display: block;
        overflow-x: auto;
    }
    
    .ims-quote-items-table .product-thumbnail {
        display: none;
    }
    
    .ims-quote-form-section {
        padding: 1.5rem;
    }
}

/* =============================================
   Quote Cart Updating State
   ============================================= */
.ims-quote-items-table tr.updating {
    opacity: 0.5;
    pointer-events: none;
}

.ims-quote-items-table tr.removing {
    animation: fadeOutRow 0.3s ease forwards;
}

@keyframes fadeOutRow {
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* =============================================
   Mini Quote Drawer
   ============================================= */
.ims-mini-quote-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 99998;
}

.ims-mini-quote-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.ims-mini-quote-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

/* Adjust for WordPress admin bar */
.admin-bar .ims-mini-quote-drawer {
    top: 32px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .ims-mini-quote-drawer {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

.ims-mini-quote-drawer.is-open {
    transform: translateX(0);
}

.ims-mini-quote-drawer__header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--color-dark) !important;
    color: #fff !important;
    flex-shrink: 0;
    min-height: 56px;
    box-sizing: border-box;
}

.ims-mini-quote-drawer__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #fff !important;
}

.ims-mini-quote-drawer__header h3 {
    color: #fff !important;
    margin: 0;
}

.ims-mini-quote-drawer__title svg {
    flex-shrink: 0;
}

.ims-mini-quote-drawer__count {
    font-weight: 400;
    opacity: 0.8;
    font-size: 0.875rem;
}

.ims-mini-quote-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ims-mini-quote-drawer__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ims-mini-quote-drawer__content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Empty State */
.ims-mini-quote-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    height: 100%;
}

.ims-mini-quote-drawer__empty-icon {
    color: var(--color-light-gray);
    margin-bottom: 1rem;
}

.ims-mini-quote-drawer__empty p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.ims-mini-quote-drawer__browse-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: #374151;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.ims-mini-quote-drawer__browse-btn:hover {
    background: var(--color-dark);
    color: #fff;
}

/* Items List */
.ims-mini-quote-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ims-mini-quote-drawer__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.ims-mini-quote-drawer__item:last-child {
    border-bottom: none;
}

.ims-mini-quote-drawer__item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
}

.ims-mini-quote-drawer__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.ims-mini-quote-drawer__item-details {
    flex: 1;
    min-width: 0;
}

.ims-mini-quote-drawer__item-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-dark);
    text-decoration: none;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.ims-mini-quote-drawer__item-name:hover {
    color: var(--color-cta);
}

.ims-mini-quote-drawer__item-sku {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-dark);
    background: var(--color-cta);
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    width: fit-content;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.ims-mini-quote-drawer__item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.ims-mini-quote-drawer__item-qty label {
    font-weight: 500;
}

.ims-mini-quote-qty {
    width: 50px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-light-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 0.75rem;
}

.ims-mini-quote-qty:focus {
    outline: none;
    border-color: var(--color-cta);
}

.ims-mini-quote-drawer__item-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ims-mini-quote-drawer__item-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Footer */
.ims-mini-quote-drawer__footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    background: var(--color-bg-light);
    border-top: 1px solid var(--color-border);
}

.ims-mini-quote-drawer__main-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--color-cta);
    color: var(--color-dark);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.ims-mini-quote-drawer__main-link:hover {
    background: #f5b32f;
    color: var(--color-dark);
}

.ims-mini-quote-drawer__main-link svg {
    flex-shrink: 0;
}

/* Body class when drawer is open */
body.ims-quote-drawer-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 480px) {
    .ims-mini-quote-drawer {
        max-width: 100%;
    }
}

