/* ================================================
   Cart Page Styles
   ================================================ */

.cart-container {
    max-width: 100%;
}

/* ---- Cart Header ---- */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.cart-title-icon {
    width: 24px;
    height: 24px;
    color: #2563eb;
}

.cart-count-badge {
    font-size: 12px;
    font-weight: 600;
    color: #1e40af;
    background: #dbeafe;
    padding: 3px 10px;
    border-radius: 12px;
}

.cart-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
}

.cart-continue-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none;
}

.cart-clear-btn {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.cart-clear-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* ---- Cart Table ---- */
.cart-table-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    text-align: left;
}

.cart-th-product {
    width: auto;
}

.cart-th-price {
    width: 110px;
    text-align: right !important;
}

.cart-th-qty {
    width: 120px;
    text-align: center !important;
}

.cart-th-total {
    width: 110px;
    text-align: right !important;
}

.cart-th-action {
    width: 50px;
}

/* Cart Rows */
.cart-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.12s;
}

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

.cart-row:hover {
    background: #fafbfc;
}

/* Product Cell */
.cart-td-product {
    padding: 14px 16px;
}

.cart-product-wrap {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.cart-product-img {
    width: 80px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

.cart-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-product-info {
    min-width: 0;
    flex: 1;
}

.cart-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.3;
    display: block;
    margin-bottom: 4px;
    transition: color 0.12s;
}

.cart-product-name:hover {
    color: #2563eb;
}

.cart-product-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #6b7280;
}

.cart-product-numbers strong {
    color: #374151;
}

.cart-product-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.cart-cert {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.04em;
}

.cart-cert-capa {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.cart-cert-nsf {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.cart-color-tag {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
}

.cart-product-eta {
    font-size: 11px;
    font-weight: 500;
}

.cart-eta-instock {
    color: #166534;
}

.cart-eta-oos {
    color: #991b1b;
}

/* Price Cell */
.cart-td-price {
    padding: 14px 16px;
    text-align: right;
    vertical-align: middle;
}

.cart-price {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    display: block;
}

.cart-list-price {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
    display: block;
}

/* Quantity Cell */
.cart-td-qty {
    padding: 14px 16px;
    text-align: center;
    vertical-align: middle;
}

.cart-qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.cart-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    color: #374151;
    transition: all 0.12s;
}

.cart-qty-btn:hover:not(:disabled) {
    background: #e5e7eb;
    color: #111827;
}

.cart-qty-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.cart-qty-value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    background: #fff;
    border-left: 1px solid #d1d5db;
    border-right: 1px solid #d1d5db;
}

/* Total Cell */
.cart-td-total {
    padding: 14px 16px;
    text-align: right;
    vertical-align: middle;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

/* Remove Button Cell */
.cart-td-action {
    padding: 14px 12px;
    text-align: center;
    vertical-align: middle;
}

.cart-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
}

.cart-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

/* ---- Promo Panel (Discount & Coupon) ---- */
.cart-promo-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 320px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.cart-promo-section {
    padding: 4px 0;
}

.cart-promo-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px;
}

.cart-promo-input-group {
    display: flex;
    gap: 8px;
}

.cart-promo-input-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s;
}

.cart-promo-input-wrap:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.cart-promo-input-prefix {
    padding: 0 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    user-select: none;
}

.cart-promo-input {
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
    background: #fff;
    color: #111827;
}

.cart-promo-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.cart-promo-input-dollar {
    border: none;
    border-radius: 0;
    padding-left: 4px;
}

.cart-promo-input-dollar:focus {
    box-shadow: none;
}

.cart-promo-apply-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.cart-promo-apply-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

.cart-promo-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cart-promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
}

.cart-promo-applied-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #166534;
}

.cart-promo-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.cart-promo-remove-btn:hover {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.cart-promo-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* ---- Cart Summary ---- */
.cart-summary {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

.cart-summary-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px 24px;
    min-width: 320px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #374151;
    padding: 6px 0;
}

.cart-summary-value {
    font-weight: 600;
}

.cart-summary-discount {
    color: #166534;
}

.cart-summary-discount-value {
    font-weight: 600;
    color: #166534;
}

.cart-summary-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.cart-summary-total {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding: 8px 0;
}

.cart-summary-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.cart-summary-note {
    font-size: 11px;
    color: #9ca3af;
    margin: 4px 0 14px;
    text-align: right;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none !important;
}

.cart-checkout-btn:hover {
    background: #1d4ed8;
    color: #fff !important;
    text-decoration: none !important;
}

.cart-checkout-btn:visited {
    color: #fff !important;
}

.cart-quote-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}

.cart-quote-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.cart-quote-btn:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

/* ---- Empty Cart ---- */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.cart-empty-icon {
    width: 64px;
    height: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.cart-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 6px;
}

.cart-empty-text {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 20px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.cart-empty-btn:hover {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .cart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-table-wrap {
        overflow-x: auto;
    }

    .cart-table {
        min-width: 600px;
    }

    .cart-summary {
        flex-direction: column;
        justify-content: stretch;
    }

    .cart-promo-panel {
        min-width: 100%;
    }

    .cart-summary-box {
        min-width: 100%;
    }
}

/* ---- Tax Tooltip ---- */
.cart-tax-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.cart-tax-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.cart-tax-info-icon {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    transition: color 0.15s;
}

.cart-tax-tooltip-wrap:hover .cart-tax-info-icon {
    color: #6b7280;
}

.cart-tax-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
}

.cart-tax-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.cart-tax-tooltip-wrap:hover .cart-tax-tooltip {
    display: block;
}
