.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 22px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--primary-color) 88%, #000);
}

.btn-primary:active {
    transform: scale(0.98);
}

.empty-cart-section {
    padding: 80px 20px;
    background: var(--surface-color);
    border-radius: 18px;
    margin: 40px auto;
    max-width: calc(1200px - 40px);
    min-height: 40vh;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    min-height: calc(70vh - var(--header-height) - 60px);
}

.empty-cart-section.visible {
    display: flex;
}

.empty-cart-wrapper {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.empty-cart-illustration {
    width: 250px;
    height: 250px;
    margin: 0 auto 32px;
    margin-bottom: 0px;
    position: relative;
}

.cart-icon {
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: iconAppear 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.cart-body {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawBody 1.2s 0.3s forwards;
}

.wheel {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    stroke-dasharray: 37.7;
    stroke-dashoffset: 37.7;
    animation: drawWheel 1s 0.4s forwards;
}

@keyframes iconAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes drawBody {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawWheel {
    to {
        stroke-dashoffset: 0;
    }
}

.empty-cart-heading {
    font-size: 1.5rem;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.empty-cart-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--primary-color);
    font-size: 0.9rem;
    color: #fff;
    border-radius: calc(var(--radius) + 4px);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.cta-button:hover {
    background: rgba(var(--primary-color-rgb), 0.9);
    transform: translateY(-2px);
}

.cta-button:active {
    transform: translateY(0);
}

.cart {
    display: none;
    padding: 40px 0;
    min-height: calc(76vh - var(--header-height) - 60px);
}

.cart.visible {
    display: block;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-header {
    margin-bottom: 10px;
}

.cart-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.cart-count {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
}

.cart-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    transition: opacity 0.2s;
    animation: fadeUp 0.3s ease both;
}

.cart-item:first-child {
    border-top: 1px solid var(--border-color);
}

.cart-item__img {
    width: 80px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    flex-shrink: 0;
}

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

.cart-item__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart-item__name {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-item__price {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.cart-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--background-color);
}

.qty__btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    font-family: inherit;
}

.qty__btn:hover {
    background: var(--surface-color);
}

.qty__val {
    width: 36px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    font-family: inherit;
    -moz-appearance: textfield;
}

.qty__val::-webkit-outer-spin-button,
.qty__val::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.cart-item__remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-family: inherit;
    transition: color 0.15s;
    margin-top: 4px;
}

.cart-item__remove:hover {
    color: #e74c3c;
}

.cart-sidebar {
    position: sticky;
    top: 80px;
}

.cart-sidebar-inner {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.82rem;
}

.sidebar-item__name {
    color: var(--text-muted);
    flex: 1;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sidebar-item__qty {
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0 16px;
}

.sidebar-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.sidebar-total strong {
    font-size: 1rem;
    font-weight: 700;
}

.btn-checkout {
    width: 100%;
}

.checkout-section {
    display: none;
    padding: 0 0 60px;
    min-height: calc(76vh - var(--header-height) - 60px);
}

.checkout-section.active {
    display: block;
    animation: fadeUp 0.35s ease both;
}

.co-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.co-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.co-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.co-back:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.co-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.co-breadcrumb__item {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.co-breadcrumb__item--active {
    color: var(--text-color);
    font-weight: 600;
}

.co-breadcrumb__item--done {
    color: var(--primary-color);
}

.co-breadcrumb__sep {
    color: var(--border-color);
    font-size: 0.75rem;
    user-select: none;
}

.co-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.co-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    background: color-mix(in srgb, var(--primary-color) 6%, transparent);
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-color);
}

.co-notice strong {
    font-weight: 600;
}

.co-notice__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 5px;
}

.co-form {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.co-form__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.co-row {
    display: grid;
    gap: 16px;
}

.co-row--2 {
    grid-template-columns: 1fr 1fr;
}

.co-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.co-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 3px;
}

.co-req {
    color: var(--primary-color);
}

.co-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.co-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--background-color);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-color);
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.co-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.co-input.is-error {
    border-color: #e74c3c;
}

.co-input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

.co-select-wrap {
    position: relative;
}

.co-select {
    padding-right: 38px;
    cursor: pointer;
}

.co-select-arrow {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

.co-textarea {
    resize: none;
    min-height: 86px;
    line-height: 1.55;
}

.co-err {
    font-size: 0.76rem;
    color: #e74c3c;
    line-height: 1.3;
    display: none;
}

.co-err.visible {
    display: block;
}

.co-err--indent {
    margin-left: 28px;
}

.co-pd {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.co-pd__label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.co-pd__box-wrap {
    flex-shrink: 0;
    position: relative;
}

.co-pd__native {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.co-pd__box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    color: transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    margin-top: 1px;
}

.co-pd__native:checked+.co-pd__box {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.co-pd__box.is-error {
    border-color: #e74c3c;
}

.co-pd__text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    user-select: none;
}

.co-pd__link {
    color: var(--primary-color);
    text-underline-offset: 2px;
}

.co-right {
    position: sticky;
    top: 80px;
}

.co-summary {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.co-summary__title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.co-summary__list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.co-summary__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
}

.co-summary__item-name {
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.co-summary__item-qty {
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.co-summary__divider {
    height: 1px;
    background: var(--border-color);
    margin-bottom: 16px;
}

.co-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.co-summary__total strong {
    font-size: 1rem;
    font-weight: 700;
}

.co-submit {
    width: 100%;
}

.order-success-section {
    display: none;
    padding: 80px 20px;
    align-items: center;
    justify-content: center;
    min-height: calc(70vh - var(--header-height) - 60px);
}

.order-success-section.active {
    display: flex;
}

.success-wrap {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: fadeUp 0.5s ease both;
}

.success-icon {
    width: 80px;
    height: 80px;
    color: var(--primary-color);
}

.success-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.success-circle-ring {
    stroke-dasharray: 170;
    stroke-dashoffset: 170;
    animation: drawRing 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.success-check {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: drawCheck 0.4s ease 0.75s forwards;
}

@keyframes drawRing {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.success-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.success-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.success-btn {
    margin-top: 8px;
}

.cart-recommendations {
    margin-top: 48px;
}

.cart-rec__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-rec__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.cart-rec__item {
    position: relative;
    background: rgba(var(--surface-color-rgb), 0.8);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    animation: fadeUp 0.4s ease both;
}

.cart-rec__item::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(120deg,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0) 70%);
    transform: translate(100%, -100%) rotate(270deg);
    transition: transform 1.7s ease;
    pointer-events: none;
}

.cart-rec__item:hover::before {
    transform: translate(-100%, 100%) rotate(270deg);
}

.cart-rec__item:hover {
    transform: translateY(-8px);
}

.cart-rec__img {
    width: 100%;
    position: relative;
    border-radius: 14px;
    background: white;
    margin-bottom: 0.5rem;
    height: 185px;
    flex-shrink: 0;
    overflow: hidden;
    aspect-ratio: unset;
}

.cart-rec__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cart-rec__name {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-rec__price {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 0;
}

.cart-rec__price::before {
    content: '\f02b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    color: var(--primary-color);
    flex-shrink: 0;
}


@media (max-width: 1024px) {
    .cart-body {
        grid-template-columns: 1fr 280px;
    }

    .co-layout {
        grid-template-columns: 1fr 300px;
        gap: 24px;
    }

    .cart-rec__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cart-body {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        position: static;
    }

    .co-layout {
        grid-template-columns: 1fr;
    }

    .co-right {
        position: static;
        order: -1;
    }

    .co-row--2 {
        grid-template-columns: 1fr;
    }

    .co-form {
        padding: 20px 16px;
    }

    .co-nav {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 20px;
    }

    .cart-rec__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .cart {
        padding: 24px 0;
    }

    .empty-cart-section {
        margin: 1rem;
        padding: 1rem;
    }

    .empty-cart-heading {
        font-size: 16px;
    }

    .empty-cart-text {
        font-size: 14px;
    }

    .cta-button {
        font-size: 12px;
        padding: 7px 14px;
    }

    .cart-icon, .empty-cart-illustration {
        height: 100px;
    }

    .cart-item {
        grid-template-columns: 64px 1fr;
        grid-template-rows: auto auto;
    }

    .cart-item__info {
        margin-left: 10px;
    }

    .cart-item__actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .co-form {
        padding: 16px 12px;
    }

    .co-form__title {
        font-size: 1rem;
    }

    .co-breadcrumb {
        display: none;
    }

    .cart-rec__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cart-rec__img {
        height: 150px;
    }

    .cart-recommendations {
        margin-top: 32px;
    }
}

@media (max-width: 400px) {
    .cart-rec__grid {
        grid-template-columns: 1fr;
    }
}

@media (hover: none) and (pointer: coarse) {
    .cart-rec__item:hover {
        transform: none;
    }

    .cart-rec__item::before {
        display: none;
    }

    .btn-primary:hover {
        background: var(--primary-color);
    }

    .cta-button:hover {
        transform: none;
        background: var(--primary-color);
    }
}