/* ============================================================
   Bharat Services – Cart CSS
   Slide-in cart panel, cart badge, cart item styles
   ============================================================ */

/* ---------- Cart Badge on nav icon ---------- */
.bs-cart-nav-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-left: 20px;
    text-decoration: none;
    color: inherit;
}

.bs-cart-nav-wrap .bs-cart-icon {
    font-size: 22px;
    color: #333;
    transition: color 0.2s;
}

.bs-cart-nav-wrap:hover .bs-cart-icon {
    color: #FD7C1C;
}

.bs-cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #FD7C1C;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
    transition: transform 0.2s;
}

.bs-cart-badge.bump {
    animation: cartBump 0.3s ease;
}

@keyframes cartBump {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ---------- Cart Overlay ---------- */
#bs-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#bs-cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Cart Sidebar ---------- */
#bs-cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

#bs-cart-sidebar.open {
    transform: translateX(0);
}

/* Header */
.bs-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}

.bs-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.bs-cart-header-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.bs-cart-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.bs-cart-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Items list */
.bs-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.bs-cart-items::-webkit-scrollbar {
    width: 4px;
}
.bs-cart-items::-webkit-scrollbar-track { background: #f1f1f1; }
.bs-cart-items::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* Empty state */
.bs-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    text-align: center;
    padding: 40px 20px;
}

.bs-cart-empty i {
    font-size: 60px;
    margin-bottom: 16px;
    color: #ddd;
}

.bs-cart-empty p {
    font-size: 16px;
    margin-bottom: 8px;
    color: #888;
}

.bs-cart-empty small {
    font-size: 13px;
    color: #bbb;
}

/* Individual cart item */
.bs-cart-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: flex-start;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bs-cart-item-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.bs-cart-item-body {
    flex: 1;
    min-width: 0;
}

.bs-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bs-cart-item-unit {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
}

.bs-cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #FD7C1C;
}

.bs-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.bs-qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #333;
}

.bs-qty-btn:hover {
    background: #FD7C1C;
    border-color: #FD7C1C;
    color: #fff;
}

.bs-qty-display {
    width: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.bs-cart-item-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    flex-shrink: 0;
    align-self: flex-start;
}

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

/* Footer / Summary */
.bs-cart-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.bs-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.bs-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 2px solid #eee;
    margin-top: 4px;
    margin-bottom: 16px;
}

.bs-cart-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.bs-cart-total-amount {
    font-size: 20px;
    font-weight: 800;
    color: #FD7C1C;
}

.bs-cart-note {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    margin-bottom: 12px;
}

.bs-cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #FD7C1C, #e8620c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.bs-cart-checkout-btn:hover {
    background: linear-gradient(135deg, #e8620c, #cc4e08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(253,124,28,0.4);
    color: #fff;
    text-decoration: none;
}

.bs-cart-continue-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    margin-top: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.bs-cart-continue-btn:hover {
    border-color: #FD7C1C;
    color: #FD7C1C;
    text-decoration: none;
}

/* ---------- Add to Cart button animation ---------- */
.btn-add-to-cart {
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart .btn-text-default { display: inline; }
.btn-add-to-cart .btn-text-adding  { display: none; }

.btn-add-to-cart.adding .btn-text-default { display: none; }
.btn-add-to-cart.adding .btn-text-adding  { display: inline; }

/* ---------- Product card hover styles ---------- */
.bs-product-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bs-product-card:hover {
    box-shadow: 0 8px 35px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.bs-product-card-img-wrap {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.bs-product-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bs-product-card:hover .bs-product-card-img-wrap img {
    transform: scale(1.06);
}

.bs-product-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.bs-product-card-body {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bs-product-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    line-height: 1.4;
}

.bs-product-price-range {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.bs-price-label { font-size: 11px; color: #999; }

.bs-price-min {
    font-size: 18px;
    font-weight: 800;
    color: #FD7C1C;
}

.bs-price-sep { color: #ccc; font-size: 14px; }

.bs-price-max {
    font-size: 15px;
    font-weight: 600;
    color: #888;
}

.bs-price-unit {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
    margin-bottom: 14px;
}

.bs-product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.bs-btn-details {
    flex: 1;
    padding: 9px 12px;
    border: 2px solid #1a1a2e;
    background: transparent;
    color: #1a1a2e;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bs-btn-details:hover {
    background: #1a1a2e;
    color: #fff;
    text-decoration: none;
}

.bs-btn-cart {
    flex: 1.2;
    padding: 9px 12px;
    background: #FD7C1C;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bs-btn-cart:hover {
    background: #e06510;
    transform: translateY(-1px);
}

/* ---------- Toast notification ---------- */
.bs-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
}

.bs-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.bs-toast i { color: #4cd964; font-size: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    #bs-cart-sidebar { width: 100vw; }
    .bs-toast { left: 16px; right: 16px; bottom: 16px; }
}
