/* Isolated package cart additions styled with Modern Tech SaaS Theme */

nav .nav-links .nws-header-cart {
    display: inline-grid;
    grid-template-columns: 36px auto;
    grid-template-rows: 36px;
    column-gap: 6px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    padding: 6px 14px;
    border-radius: 9999px;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
}

nav .nav-links .nws-header-cart:hover {
    color: var(--primary);
    background: var(--primary-subtle);
    border-color: var(--primary-border);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.nws-header-cart svg {
    grid-area: 1 / 1;
    width: 20px;
    height: 20px;
    justify-self: center;
    align-self: center;
}

.nws-header-cart-count {
    grid-area: 1 / 1;
    justify-self: end;
    align-self: start;
    transform: translate(2px, -2px);
    background: var(--gradient-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    min-width: 16px;
    height: 16px;
    padding: 2px 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.nws-header-cart-label {
    grid-area: 1 / 2;
    align-self: center;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1;
}

nav .nws-header-cart:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.nws-cart-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.nws-cart-actions > .btn {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    font-size: 0.88rem;
    text-align: center;
}

.nws-cart-actions > .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #cbd5e1 !important;
}

/* Floating Cart Widget */
.nws-cart-link {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 1100;
    display: grid;
    grid-template-columns: 36px auto;
    grid-template-rows: 36px;
    column-gap: 8px;
    align-items: center;
    padding: 10px 22px;
    border-radius: 9999px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #ffffff;
    font: 700 15px/1.4 'Plus Jakarta Sans', sans-serif;
    text-decoration: none;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.35);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nws-cart-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
    background: #1e293b;
    border-color: #475569;
}

.nws-cart-link svg {
    grid-area: 1 / 1;
    width: 22px;
    height: 22px;
    justify-self: center;
    align-self: center;
    color: #60a5fa;
}

.nws-floating-cart-count {
    grid-area: 1 / 1;
    justify-self: end;
    align-self: start;
    transform: translate(4px, -3px);
    background: var(--gradient-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 2px 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nws-floating-cart-label {
    grid-area: 1 / 2;
    align-self: center;
    line-height: 1;
    font-weight: 700;
}

.nws-cart-notice {
    position: fixed;
    right: 28px;
    bottom: 96px;
    z-index: 1101;
    max-width: min(380px, calc(100vw - 48px));
    padding: 16px 22px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(10px);
}

.nws-cart-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Standalone Cart Page Layout */
.nws-cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 160px 24px 100px;
    min-height: 70vh;
}

.nws-cart-page h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    margin-bottom: 24px;
    color: var(--text-primary);
}

.nws-cart-page .nws-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    margin: 36px 0;
    align-items: start;
}

.nws-cart-item {
    padding: 28px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.nws-cart-item h2 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin: 0 0 10px;
    text-align: left;
}

.nws-cart-item p {
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.nws-cart-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nws-cart-controls label {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.nws-cart-controls input {
    width: 76px;
    padding: 8px 12px;
    margin-bottom: 0;
}

.nws-cart-remove {
    color: #ef4444;
    background: transparent;
    border: 0;
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.nws-cart-remove:hover {
    color: #dc2626;
}

.nws-cart-summary {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}

.nws-cart-summary h2 {
    font-size: 1.45rem;
    margin-top: 0;
    color: var(--text-primary);
    text-align: left;
}

.nws-cart-summary strong {
    display: block;
    font-size: 1.45rem;
    color: var(--primary);
    margin: 12px 0 20px;
}

.nws-cart-summary .btn {
    width: 100%;
}

.nws-cart-page [hidden] {
    display: none !important;
}

.nws-cart-page a:focus-visible,
.nws-cart-page button:focus-visible,
.nws-cart-link:focus-visible,
.nws-add-cart:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
}

@media (max-width: 768px) {
    .nws-cart-page .nws-cart-layout {
        grid-template-columns: 1fr;
    }
    .nws-cart-page {
        padding-top: 130px;
    }
    .nws-cart-link {
        right: 18px;
        bottom: 18px;
    }
    .nws-cart-controls {
        gap: 14px;
    }
}