/**
 * Sidebar Cart CSS
 * Slide-in panel sa desne strane
 * Boje: identične sajtu (#2d3d33, #bf8302, #f0f0f0)
 */

/* Overlay */
.ng-sidebar-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ng-sidebar-cart-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar panel */
.ng-sidebar-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(45,61,51,0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ng-sidebar-cart.is-open {
    transform: translateX(0);
}

/* Inner wrapper za scroll */
.ng-sidebar-cart-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.ng-sidebar-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    background: #2d3d33;
    color: #fff;
    flex-shrink: 0;
}

.ng-sidebar-cart-header h5 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    font-family: 'Source Sans 3', sans-serif;
    letter-spacing: 0.3px;
}

.ng-sidebar-cart-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.85;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.ng-sidebar-cart-close:hover {
    opacity: 1;
}

/* Prazna korpa */
.ng-sidebar-cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.ng-sidebar-cart-empty p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.ng-sidebar-cart-empty .btn-ng-secondary {
    font-size: 13px;
    padding: 9px 20px;
}

/* Lista stavki */
.ng-sidebar-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: #2d3d33 #f0f0f0;
}

.ng-sidebar-cart-items::-webkit-scrollbar {
    width: 4px;
}

.ng-sidebar-cart-items::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.ng-sidebar-cart-items::-webkit-scrollbar-thumb {
    background: #2d3d33;
    border-radius: 2px;
}

/* Pojedinačna stavka */
.ng-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

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

.ng-cart-item-img {
    flex-shrink: 0;
}

.ng-cart-item-img img {
    width: 64px;
    height: 63px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

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

.ng-cart-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d3d33;
    text-decoration: none;
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ng-cart-item-name:hover {
    color: #bf8302;
}

.ng-cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #2d3d33;
    margin-bottom: 8px;
}

.ng-cart-item-price .woocommerce-Price-amount {
    color: #2d3d33;
    font-size: 14px;
}

/* Qty controls u sidebar */
.ng-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ng-qty-btn {
    background: #2d3d33;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
    padding: 0;
}

.ng-qty-btn:hover {
    background: #bf8302;
}

.ng-qty-count {
    font-size: 14px;
    font-weight: 600;
    color: #2d3d33;
    min-width: 20px;
    text-align: center;
}

/* Remove dugme */
.ng-cart-item-remove {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.ng-cart-item-remove:hover {
    color: #c00;
}

/* Footer korpe */
.ng-sidebar-cart-footer {
    padding: 16px 16px 20px;
    background: #f8f8f8;
    border-top: 2px solid #2d3d33;
    flex-shrink: 0;
}

.ng-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 16px;
    color: #333;
}

.ng-cart-total strong {
    font-size: 18px;
    color: #2d3d33;
}

.ng-sidebar-cart-footer .btn-ng-primary,
.ng-sidebar-cart-footer .btn-ng-checkout,
.ng-sidebar-cart-footer .btn-ng-phone {
    margin-bottom: 8px;
    font-size: 14px;
    padding: 11px 16px;
}

.ng-sidebar-cart-footer .btn-ng-phone {
    font-size: 13px;
    padding: 9px 16px;
}

/* Loading spinner na karticama */
@keyframes ng-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.ng-btn-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ng-spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

/* Cart ikonica u navbaru */
.ng-nav-cart-item {
    position: relative;
}

.ng-nav-cart-link {
    display: flex !important;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    position: relative;
    padding: 0 10px !important;
}

.ng-nav-cart-link svg {
    vertical-align: middle;
}

.ng-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #bf8302;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    padding: 0 3px;
    line-height: 1;
    position: absolute;
    top: -6px;
    right: 2px;
    font-family: 'Source Sans 3', sans-serif;
}

.ng-cart-count:empty {
    display: none;
}

/* Body lock dok je sidebar otvoren */
body.ng-cart-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 480px) {
    .ng-sidebar-cart {
        width: 100%;
    }
}
