/* ============================================================
   CdA Ferramentas — Produto Woo (Convert)
   v4.0.0
   ============================================================ */

/* ── Galeria de Imagens ──────────────────────────────────── */
.cdaf-pi-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

/* Galeria à direita: inverte ordem */
.cdaf-pi-wrap--right {
    flex-direction: row-reverse;
}

/* Galeria em baixo: coluna */
.cdaf-pi-wrap--col {
    flex-direction: column;
}

/* Miniaturas laterais */
.cdaf-pi-thumbs--side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 480px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.2) transparent;
    flex-shrink: 0;
    width: 80px;
}

/* Miniaturas em baixo */
.cdaf-pi-thumbs--bottom {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,.2) transparent;
}

/* Miniatura individual */
.cdaf-pi-thumb {
    flex-shrink: 0;
    transition: opacity .2s;
    outline: none;
    background: transparent;
}
.cdaf-pi-thumb:hover,
.cdaf-pi-thumb:focus {
    opacity: .85;
}
.cdaf-pi-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: border-color .2s;
    background: transparent;
}
.cdaf-pi-thumb.is-active img {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--cdaf-thumb-active-color, #96588a);
}

/* Imagem principal */
.cdaf-pi-main {
    flex: 1 1 0;
    min-width: 0;
    background: transparent;
}
.cdaf-pi-main img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity .25s;
    background: transparent;
}

/* Lightbox */
.cdaf-pi-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.cdaf-pi-lightbox[hidden] { display: none; }
.cdaf-pi-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    cursor: default;
}
.cdaf-pi-lb-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background .15s;
}
.cdaf-pi-lb-close:hover {
    background: rgba(255,255,255,.15);
}

/* ── Adicionar ao Carrinho ───────────────────────────────── */
.cdaf-atc-wrap {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

/* Botão */
.cdaf-atc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    padding: 14px 24px;
    background: #96588a;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, opacity .2s, transform .1s;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.cdaf-atc-btn:hover {
    background: #7a4672;
    text-decoration: none;
    color: #fff;
}
.cdaf-atc-btn:active {
    transform: scale(.98);
}
.cdaf-atc-btn.is-loading {
    opacity: .7;
    pointer-events: none;
}
.cdaf-atc-btn.is-added {
    background: #4caf50;
    pointer-events: none;
}
.cdaf-atc-btn.is-error {
    background: #e53935;
}
.cdaf-atc-btn--unavailable {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}
.cdaf-atc-btn--variable {
    background: #2196f3;
}
.cdaf-atc-btn--variable:hover {
    background: #1976d2;
}

/* Spinner no botão */
.cdaf-atc-btn.is-loading .cdaf-atc-btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cdaf-spin .7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* SVG ícone */
.cdaf-atc-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Seletor de quantidade */
.cdaf-atc-qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
    flex-shrink: 0;
    width: fit-content;
    /* Garante que o radius apareça corretamente */
    isolation: isolate;
}
.cdaf-atc-qty button {
    background: #f5f5f5 !important;
    border: none;
    padding: 0 14px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #333 !important;
    transition: background .15s;
    min-height: 40px;
    line-height: 1;
    box-shadow: none;
}
.cdaf-atc-qty button:first-child {
    border-radius: inherit;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.cdaf-atc-qty button:last-child {
    border-radius: inherit;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.cdaf-atc-qty button:hover {
    background: #e0e0e0 !important;
}
.cdaf-atc-qty input {
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    width: 56px;
    font-size: 1rem;
    padding: 0 4px;
    -moz-appearance: textfield;
    color: #333;
    background: #fff !important;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}
.cdaf-atc-qty input::-webkit-outer-spin-button,
.cdaf-atc-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Mensagem deslogado */
.cdaf-atc-guest {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 4px;
    border: none;
    box-sizing: border-box;
    width: 100%;
}
.cdaf-atc-guest-msg {
    margin: 0;
    font-size: .95rem;
    color: #555;
    line-height: 1.5;
}
.cdaf-atc-guest-link {
    display: inline-block;
    font-weight: 600;
    color: #96588a;
    text-decoration: underline;
    transition: color .15s;
}
.cdaf-atc-guest-link:hover {
    color: #7a4672;
}

/* Responsivo */
@media (max-width: 600px) {
    .cdaf-pi-thumbs--side {
        max-height: 320px;
        width: 56px !important;
    }
}

/* ── Acordeão de Detalhes do Produto ────────────────────── */
.cdaf-acc-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Ajuste 01: espaço entre seções */
}

/* Quando wrapper do Elementor usa flex, garantir que o acordeão expande */
.elementor-widget-cdaf_produto_acordeao,
.elementor-widget-cdaf_produto_acordeao .elementor-widget-container {
    width: 100%;
    max-width: 100%;
}

.cdaf-acc-item {
    border-top: none;
    width: 100%;
    box-sizing: border-box;
}
.cdaf-acc-item:first-child {
    border-top: none;
}

/* Cabeçalho */
.cdaf-acc-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 18px;
    background: transparent;
    border: none !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-left: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    gap: 12px;
    transition: background .18s, color .18s;
    line-height: 1.4;
    border-radius: 0 !important;
}
.cdaf-acc-header:hover,
.cdaf-acc-header:focus,
.cdaf-acc-header:active,
.cdaf-acc-header:focus-visible {
    background: rgba(0,0,0,.04);
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
.cdaf-acc-title {
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
}

/* Ícone — sempre no final (direita) */
.cdaf-acc-icon {
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: color .18s;
}
.cdaf-acc-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Alterna ícones aberto/fechado */
.cdaf-acc-icon-open  { display: none; }
.cdaf-acc-icon-closed { display: flex; }
.cdaf-acc-item.is-open .cdaf-acc-icon-open  { display: flex; }
.cdaf-acc-item.is-open .cdaf-acc-icon-closed { display: none; }

/* Corpo — controlado por JS (hidden attr + animação de altura) */
.cdaf-acc-body {
    background: transparent;
}
.cdaf-acc-body-inner {
    padding: 16px 18px;
}

/* Descrição — reseta estilos do WooCommerce */
.cdaf-acc-description p { margin-bottom: .8em; }
.cdaf-acc-description p:last-child { margin-bottom: 0; }
.cdaf-acc-description ul,
.cdaf-acc-description ol { padding-left: 1.4em; margin-bottom: .8em; }
.cdaf-acc-description h1,.cdaf-acc-description h2,
.cdaf-acc-description h3,.cdaf-acc-description h4 { margin: .8em 0 .4em; }

/* Ficha técnica — lista simples */
.cdaf-acc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cdaf-acc-list li {
    font-size: .9rem;
    line-height: 1.5;
    color: inherit;
}
.cdaf-acc-list strong {
    font-weight: 700;
    color: inherit;
}

.cdaf-acc-empty {
    color: #999;
    font-style: italic;
    margin: 0;
    font-size: .9rem;
}
