/**
 * Perfect Store — Layout centralizado e organização global
 */
:root {
    --ps-site-max: 1200px;
    --ps-site-gutter: 16px;
    --ps-card-radius: 10px;
    --ps-border: #ebebeb;
}

@media (min-width: 768px) {
    :root {
        --ps-site-gutter: 20px;
    }
}

/* Container centralizado em todo o site */
body.is-enterprise-retail .container {
    max-width: var(--ps-site-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ps-site-gutter);
    padding-right: var(--ps-site-gutter);
}

body.is-enterprise-retail .wrapper > section {
    width: 100%;
}

/* Steps / wizard centralizados */
body.is-enterprise-retail .ps-checkout-flow-steps,
body.is-enterprise-retail .ps-wizard-steps {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

body.is-enterprise-retail .ps-checkout-flow-steps__list {
    justify-content: center;
}

/* ── Carrinho página ── */
body.is-enterprise-retail .cart-wrap {
    padding: 20px 0 40px;
}

body.is-enterprise-retail .cart-wrap > .container {
    max-width: var(--ps-site-max);
}

body.is-enterprise-retail .cart-wrap .cart {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 992px) {
    body.is-enterprise-retail .cart-wrap .cart {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 24px;
    }
}

body.is-enterprise-retail .cart-wrap .cart-inner {
    background: #fff;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-card-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.is-enterprise-retail .cart-wrap .cart-table thead {
    background: #f9fafb;
    border-bottom: 1px solid var(--ps-border);
}

body.is-enterprise-retail .cart-wrap .cart-table thead th {
    padding: 12px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    vertical-align: middle;
    border: none;
}

body.is-enterprise-retail .cart-wrap .cart-table tbody td {
    padding: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f3f4f6;
}

body.is-enterprise-retail .cart-wrap .cart-table tbody tr:last-child td {
    border-bottom: none;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-image {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-name {
    display: block;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.35;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-options {
    margin-top: 4px;
    text-align: left;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-options li {
    font-size: 10px;
    color: #6b7280;
}

body.is-enterprise-retail .cart-wrap .cart-table td label {
    display: none;
}

body.is-enterprise-retail .cart-wrap .cart-table .product-price {
    font-weight: 700;
    white-space: nowrap;
}

body.is-enterprise-retail .cart-wrap .number-picker .input-group-quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    overflow: hidden;
}

body.is-enterprise-retail .cart-wrap .number-picker .btn-number {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #f3f4f6;
}

body.is-enterprise-retail .cart-wrap .number-picker .input-quantity {
    width: 40px;
    height: 32px;
    padding: 0;
    border: none;
    border-left: 1px solid var(--ps-border);
    border-right: 1px solid var(--ps-border);
    text-align: center;
    font-weight: 600;
}

body.is-enterprise-retail .cart-wrap .btn-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    transition: color 0.15s ease, background 0.15s ease;
}

body.is-enterprise-retail .cart-wrap .btn-remove:hover {
    color: #dc2626;
    background: #fef2f2;
}

body.is-enterprise-retail .cart-wrap .order-summary-wrap {
    width: 100%;
}

body.is-enterprise-retail .cart-wrap .order-summary {
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-card-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.is-enterprise-retail .cart-wrap .order-summary-top {
    padding: 16px 16px 0;
}

body.is-enterprise-retail .cart-wrap .ps-cart-summary-count {
    margin: 4px 0 0;
    font-size: 11px;
    color: #6b7280;
}

body.is-enterprise-retail .cart-wrap .order-summary-middle {
    padding: 12px 16px;
}

body.is-enterprise-retail .cart-wrap .order-summary-bottom {
    padding: 0 16px 16px;
}

body.is-enterprise-retail .cart-wrap .order-summary-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

body.is-enterprise-retail .cart-wrap .order-summary-list li:last-child {
    border-bottom: none;
}

body.is-enterprise-retail .cart-wrap .ps-login-gate {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

body.is-enterprise-retail .cart-wrap .ps-login-gate a.ps-login-gate__btn {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    text-align: center;
}

/* Mobile: carrinho em cards */
@media (max-width: 991px) {
    body.is-enterprise-retail .cart-wrap .cart-inner {
        border: none;
        box-shadow: none;
        background: transparent;
    }

    body.is-enterprise-retail .cart-wrap .cart-table thead {
        display: none;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px 12px;
        padding: 14px;
        margin-bottom: 10px;
        border: 1px solid var(--ps-border);
        border-radius: var(--ps-card-radius);
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        position: relative;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td {
        padding: 0;
        border: none;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:first-child {
        flex: 0 0 72px;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(2) {
        flex: 1 1 calc(100% - 96px);
        min-width: 0;
        padding-right: 36px;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(3),
    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(4),
    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(5) {
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 90px;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(3)::before {
        content: "Preço";
        font-size: 9px;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(4)::before {
        content: "Qtd";
        font-size: 9px;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:nth-child(5)::before {
        content: "Total";
        font-size: 9px;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
    }

    body.is-enterprise-retail .cart-wrap .cart-table tbody td:last-child {
        position: absolute;
        top: 10px;
        right: 10px;
        width: auto;
    }

    body.is-enterprise-retail .cart-wrap .cart-table .product-image {
        width: 72px;
        height: 72px;
    }
}

/* ── Checkout centralizado ── */
body.is-enterprise-retail .checkout-wrap > .container {
    max-width: var(--ps-site-max);
}

body.is-enterprise-retail .checkout-wrap .checkout-left {
    background: #fff;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-card-radius);
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.is-enterprise-retail .checkout-wrap .checkout-right .order-summary {
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-card-radius);
}

@media (max-width: 991px) {
    body.is-enterprise-retail .checkout-wrap .checkout-left {
        padding: 16px;
    }
}

/* ── Home seções centralizadas ── */
body.is-enterprise-retail .featured-categories-wrap .container,
body.is-enterprise-retail .grid-products-wrap .container,
body.is-enterprise-retail .landscape-tab-products-wrap .container {
    max-width: var(--ps-site-max);
}

body.is-enterprise-retail .products-slider .swiper-wrapper {
    align-items: stretch;
}

/* ── Carrinho lateral (Kenner) ── */
@media (min-width: 992px) {
    .kenner-cart-wrap {
        left: auto !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 420px !important;
        border-left: 1px solid var(--ps-border);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1) !important;
    }
}

.kenner-cart-wrap {
    display: flex !important;
    flex-direction: column;
}

.kenner-cart-header {
    padding: 16px var(--ps-site-gutter) 12px !important;
    min-height: auto !important;
}

.kenner-cart-header h2 {
    text-align: center;
    width: 100%;
}

.kenner-cart-count {
    font-weight: 600;
    color: #6b7280;
}

.kenner-cart-freeship {
    padding: 0 var(--ps-site-gutter) 12px !important;
}

.kenner-cart-items {
    padding: 0 !important;
}

.kenner-cart-item {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px !important;
    align-items: start !important;
    padding: 14px var(--ps-site-gutter) !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.kenner-cart-item-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kenner-cart-item-name {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #1a1a1a !important;
    text-decoration: none;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kenner-cart-item-meta {
    font-size: 10px !important;
    color: #6b7280 !important;
    white-space: normal !important;
}

.kenner-cart-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.kenner-cart-item-price {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
}

.kenner-cart-item-image {
    width: 72px !important;
    height: 72px !important;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.kenner-cart-item-actions {
    flex-shrink: 0;
}

.kenner-cart-qty {
    border: 1px solid var(--ps-border);
    border-radius: 6px;
    overflow: hidden;
    height: 28px !important;
}

.kenner-cart-qty-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    flex-basis: 28px !important;
    background: #f3f4f6 !important;
    color: #1a1a1a !important;
    font-size: 14px !important;
}

.kenner-cart-qty-value {
    min-width: 28px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 11px !important;
}

.kenner-cart-remove-btn {
    display: inline-flex !important;
    margin-left: 6px !important;
}

.kenner-cart-footer {
    padding: 14px var(--ps-site-gutter) calc(14px + env(safe-area-inset-bottom, 0)) !important;
    border-top: 1px solid var(--ps-border) !important;
    background: #fafafa !important;
}

.kenner-cart-totals {
    background: #fff;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    padding: 4px 12px;
    margin-bottom: 12px !important;
}

.kenner-cart-coupon {
    margin-bottom: 10px !important;
}

.kenner-cart-coupon-input {
    border-radius: 6px !important;
}

.kenner-cart-coupon-btn {
    border-radius: 6px !important;
}

.kenner-cart-btn {
    border-radius: 6px !important;
}

.kenner-cart-btn-primary {
    background: var(--color-primary, #1a1a1a) !important;
}

.kenner-cart-empty {
    padding: 48px var(--ps-site-gutter) !important;
}

/* Remover layout antigo */
.kenner-cart-item-main,
.kenner-cart-item-bottom,
.kenner-cart-item-stack {
    display: contents;
}

@media (max-width: 991px) {
    .kenner-cart-wrap {
        max-width: 100% !important;
    }
}
