/* =============================================================
   custom-cart.css  v1.2.5
   ============================================================= */

/* ── 1. Layout principal: 2 colunas ────────────────────────── */

.cc-wrap {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
    padding-bottom: 40px;
}

.cc-col {
    min-width: 0;
}

/* ── 2. Lista de itens ─────────────────────────────────────── */

.cc-item-list {
    display: flex;
    flex-direction: column;
}

.cc-item-divider {
    border: none;
    border-top: 1px solid #EBEBEB;
    margin: 20px 0;
}

.cc-empty {
    color: #888;
    font-size: 15px;
}

/* ── 3. Card de produto ────────────────────────────────────── */

.cc-item-card {
    position: relative;
}

/* Linha 1: foto + info */
.cc-item-row1 {
    display: grid;
    grid-template-columns: 100px 2fr;
    gap: 16px;
}

/* Foto */
.cc-item-thumb-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f5;
}

.cc-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info da direita */
.cc-item-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 5px;
}

/* Título + lixeira */
.cc-item-title-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-start;
    gap: 8px;
}

.cc-item-title {
    font-size: 19px;
    letter-spacing: 0.05em;
    font-weight: 400;
    color: #000;
    line-height: 1.25;
}

.cc-delete-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity .15s;
}

.cc-delete-btn:hover {
    opacity: 1;
}

/* Qty + preço */
.cc-item-qty-price-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
}

/* Contador */
.cc-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid #D5D5D5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.cc-qty-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    font-size: 17px;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    line-height: 1;
}

.cc-qty-btn:hover {
    background: #f5f5f5;
}

.cc-qty-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    border-left: 1.5px solid #D5D5D5;
    border-right: 1.5px solid #D5D5D5;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* Preços */
.cc-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.cc-price-regular {
    font-size: 13px;
    font-weight: 400;
    color: #B8B8B9;
    text-decoration: line-through;
}

.cc-price-sale {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.cc-price-only {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

/* ── Linha 2: descrição + editar tamanho ── */

.cc-item-row2 {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.cc-item-size-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

.cc-edit-size-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #555;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s;
    text-align: right;
}

.cc-edit-size-btn:hover {
    color: #000;
}

/* ── Painel de edição de tamanho ── */

.cc-size-edit-panel {
    margin-top: 12px;
    padding: 16px;
    background: #fafafa;
    border-radius: 10px;
    border: 1px solid #EBEBEB;
}

.cc-size-edit-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ── Overlay de exclusão ── */

.cc-delete-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .88);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 10;
}

.cc-delete-overlay>span {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.cc-delete-overlay-actions {
    display: flex;
    gap: 10px;
}

/* ── 4. Botões de tamanho (reutiliza estilos do tema filho) ── */

.cc-size-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 80px;
    padding: 12px 10px;
    border: 1.5px solid #d5d5d5;
    border-radius: 12px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    line-height: 1.2;
    text-align: center;
    flex: 1;
}

.cc-size-btn:hover:not(.cc-size-btn--unavailable) {
    border-color: #888;
}

.cc-size-btn:hover[data-slug=rn] {
    background: #F5EADD;
}

.cc-size-btn:hover[data-slug=p] {
    background: #FFF1D1;
}

.cc-size-btn:hover[data-slug=m] {
    background: #FFEBE3;
}

.cc-size-btn:hover[data-slug=g] {
    background: #EDF0FF;
}

.cc-size-btn:hover[data-slug=xg] {
    background: #E0E9E0;
}


.cc-size-btn.cc-size-btn--unavailable {
    opacity: 0.38;
    cursor: not-allowed;
    text-decoration: line-through;
}

.cc-size-btn.cc-size-btn--active {
    border-color: #B8B8B9;
    background: #fdf0f0;
    color: #000;
}

/* ── 5. Botão "Incluir mais tamanhos" ──────────────────────── */

.cc-add-more-wrap {
    margin-top: 24px;
}

.cc-add-more-btn {
    background: none;
    border: 1.5px dashed #B8B8B9;
    border-radius: 10px;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s, color .15s;
}

.cc-add-more-btn:hover {
    border-color: #555;
    color: #222;
}

.cc-add-more-panel {
    margin-top: 16px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #EBEBEB;
    border-radius: 12px;
    position: relative;
}

/* Grid de produtos */
.cc-product-grid {
    display: grid;
    gap: 12px;
}

.cc-product-grid[data-cols="1"] {
    grid-template-columns: 1fr;
}

.cc-product-grid[data-cols="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.cc-product-grid[data-cols="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.cc-product-card {
    background: #fff;
    border: 1.5px solid #D5D5D5;
    border-radius: 10px;
    padding: 14px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: border-color .15s;
    font-size: 13px;
    color: #333;
}

.cc-product-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.cc-product-card:hover {
    border-color: #888;
}

.cc-product-card.cc-product-card--active {
    border-color: #000;
    background: #f9f9f9;
}

#cc-add-size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* ── 6. Coluna de resumo (direita) ─────────────────────────── */

.cc-col--summary {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: sticky;
    top: 24px;
}

.cc-block {
    padding: 20px 0;
    border-bottom: 1px solid #EBEBEB;
}

.cc-block:first-child {
    padding-top: 0;
}

.cc-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Campo + botão */
.cc-field-row {
    display: flex;
    gap: 8px;
}

.cc-input {
    flex: 1 1 auto;
    border: 1.5px solid #FFF1D1 !important;
    border-radius: 8px;
    padding: 10px 12px !important;
    font-size: 14px;
    color: #333 !important;
    outline: none;
    transition: border-color .15s;
    min-width: 0;
}

.cc-input:focus {
    border-color: #888;
}

/* ── Opções de frete ── */

.cc-shipping-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cc-shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.cc-ship-label {
    flex: 1 1 auto;
}

.cc-ship-cost {
    font-weight: 600;
    white-space: nowrap;
}

/* ── Cupom resultado ── */

.cc-coupon-result {
    margin-top: 8px;
    font-size: 13px;
}

.cc-coupon-ok {
    color: #2a7a2a;
}

.cc-error {
    color: #c0392b;
}

/* ── Totais ── */

.cc-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #444;
    padding: 6px 0;
}

.cc-totals-discount {
    color: #2a7a2a;
}

.cc-totals-total {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    padding-top: 10px;
    border-top: 1px solid #EBEBEB;
    margin-top: 4px;
}

.cc-disclaimer {
    font-size: 12px;
    color: #B8B8B9;
    margin: 4px 0 0;
}

/* ── 7. Botões gerais ──────────────────────────────────────── */

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background .15s, color .15s, border-color .15s;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #000;
}

.cc-btn--primary {
    background: #E0E9E0;
    color: #000;
    border: 1px solid #000;
    border-radius: 50px;
}

.cc-btn--primary:hover {
  opacity: 0.9;
}

.cc-btn--secondary {
    background: #FFF1D1;
    border-color: #D5D5D5;
    min-width: 120px;
}

.cc-btn--secondary:hover {
    opacity: 0.8;
}

.cc-btn--ghost {
    background: transparent;
    text-decoration: underline;
    color: #000;
}

.cc-btn--ghost:hover {
   opacity: 0.8;
}

.cc-btn--danger {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.cc-btn--danger:hover {
    background: #a93226;
    border-color: #a93226;
}

.cc-btn--full {
    width: 100%;
    display: flex;
}

.cc-actions-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── 8. Skeleton ───────────────────────────────────────────── */

@keyframes cc-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.cc-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: cc-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
}

/* Card skeleton */
.cc-skeleton-card {
    display: grid;
    grid-template-columns: 100px 2fr;
    gap: 16px;
    padding: 4px 0;
}

.cc-skeleton-thumb {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    width: 100%;
}

.cc-skeleton-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 5px;
}

.cc-skeleton-title {
    height: 20px;
    width: 65%;
}

.cc-skeleton-subtitle {
    height: 14px;
    width: 40%;
}

.cc-skeleton-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cc-skeleton-qty {
    height: 32px;
    width: 100px;
    border-radius: 8px;
}

.cc-skeleton-price {
    height: 18px;
    width: 70px;
    margin-left: auto;
}

/* ── 8b. Loading overlay ───────────────────────────────────── */

.cc-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 20;
}

/* Overlay global sobre o shortcode inteiro */
.cc-wrap--busy {
    pointer-events: none;
}

.cc-wrap--busy::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .80);
    z-index: 999;
}

.cc-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #D5D5D5;
    border-top-color: #333;
    border-radius: 50%;
    animation: cc-spin .6s linear infinite;
    display: inline-block;
}

@keyframes cc-spin {
    to {
        transform: rotate(360deg);
    }
}

.cc-loading-text {
    font-size: 13px;
    color: #888;
    text-align: center;
    width: 100%;
}

/* ── 8c. Pill de cupom (fica dentro de #cc-discount-row) ───── */

.cc-coupon-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0faf0;
    border: 1.5px solid #7ec47e;
    border-radius: 20px;
    padding: 2px 8px 2px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #2a7a2a;
    letter-spacing: .03em;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}

.cc-coupon-pill-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7ec47e;
    font-size: 15px;
    line-height: 1;
    transition: color .15s;
    flex-shrink: 0;
}

.cc-coupon-pill-remove:hover {
    color: #c0392b;
}

/* ── 8d. Modal de timeout ──────────────────────────────────── */

.cc-timeout-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.cc-timeout-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cc-timeout-msg {
    font-size: 15px;
    color: #333;
    line-height: 1.55;
    margin: 0;
    text-align: center;
}

.cc-timeout-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ── 9. Mobile sticky footer ───────────────────────────────── */

.cc-mobile-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .10);
}

.cc-mobile-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #000;
    border-bottom: 1px solid #EBEBEB;
}

.cc-mobile-footer .cc-btn--primary {
    margin: 10px 16px;
    width: calc(100% - 32px);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 15px;
}

/* ── 10. Responsivo mobile ─────────────────────────────────── */

@media (max-width: 900px) {
    .cc-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .cc-col--summary {
        position: static;
    }

    /* Esconde totais/checkout no body em mobile (fica no footer fixo) */
    .cc-totals-block,
    .cc-actions-block {
        display: none;
    }

    .cc-mobile-footer {
        display: block;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* Espaço para o footer fixo não cobrir conteúdo */
    .cc-wrap {
        padding-bottom: 120px;
    }
}

@media (max-width: 600px) {
    .cc-item-title {
        font-size: 16px;
    }

    .cc-item-row1 {
        gap: 12px;
    }

    .cc-size-btn {
        min-width: 64px;
        padding: 10px 8px;
    }

    .cc-product-grid[data-cols="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
}