/* =========================================================
   PRODUCT CARD
   Arquivo: public/assets/cliente/css/product-card.css
   ========================================================= */

/* =========================================================
   GRID
   ========================================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.product-grid-store {
    grid-template-columns: 1fr;
    gap: 14px;
}

/* =========================================================
   CARD
   ========================================================= */
.product-card {
    position: relative;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 22px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.product-card-store {
    padding: 10px;
}

.product-card-store-main {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.product-card-store-image-wrap {
    width: 84px;
    height: 84px;
    border-radius: 16px;
    overflow: hidden;
    background: #f3f3f3;
    flex: 0 0 auto;
}

.product-card-image,
.product-card-store-image,
.product-card-store-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card-image-placeholder,
.product-card-store-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0b0b0;
    font-size: 30px;
}

.product-card-store-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-card-title {
    margin: 0;
    color: #222;
    font-weight: 800;
}

.product-card-store-title {
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}

/* =========================================================
   GATILHOS
   ========================================================= */
.product-card-store-image-trigger,
.product-card-store-title-trigger {
    cursor: pointer;
}

.product-card-store-image-trigger {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: inherit;
    overflow: hidden;
}

.product-card-store-image-trigger .product-card-store-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card-store-title-trigger {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: inherit;
    font: inherit;
}

.product-card-store-title-trigger:hover {
    opacity: 0.92;
}

/* =========================================================
   DESCRIÇÃO
   ========================================================= */
.product-card-description-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.product-card-store-description-wrap {
    gap: 2px;
    min-width: 0;
}

.product-card-description {
    color: #666;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 64px;
}

.product-card-store-description {
    font-size: 12px;
    line-height: 1.38;
    color: #666;
    -webkit-line-clamp: 2;
    min-height: 34px;
    margin: 0;
}

.product-card-description-wrap.is-expanded .product-card-description {
    display: block;
    -webkit-line-clamp: initial;
    overflow: visible;
    min-height: 0;
}

.product-card-description-toggle {
    border: 0;
    background: #fff3cd;
    color: #7a5a00;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.product-card-store-description-toggle {
    align-self: flex-end;
    padding: 0;
    background: transparent;
    color: #7f7f7f;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: none;
    margin-top: 1px;
}

.product-card-description-toggle:hover {
    opacity: 0.92;
}

/* =========================================================
   PREÇO / AÇÕES
   ========================================================= */
.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #df1f26;
}

.product-card-store-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.product-card-store-price {
    margin: 0;
    font-size: 23px;
    line-height: 1;
    font-weight: 800;
    color: #df1f26;
    flex: 0 1 auto;
}

.product-card-store-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

/* =========================================================
   CONTROLE DE QUANTIDADE
   ========================================================= */
.product-card-qty-control {
    width: auto;
    min-width: 126px;
    max-width: 138px;
    min-height: 40px;
    background: #fff5f5;
    border: 1px solid rgba(223, 31, 38, 0.12);
    border-radius: 999px;
    display: grid;
    grid-template-columns: 34px minmax(22px, auto) 34px;
    align-items: center;
    gap: 8px;
    padding: 4px;
    margin: 0;
}

.product-card-qty-control.is-empty {
    background: #f8f8f8;
    border-color: #ececec;
}

.product-card-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.18s ease;
    border: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1;
}

.product-card-qty-btn.is-minus {
    background: #f2f2f2;
    color: #666;
}

.product-card-qty-btn.is-plus {
    background: #df1f26;
    color: #fff;
}

.product-card-qty-btn.is-added {
    transform: scale(0.94);
}

.product-card-qty-btn:hover {
    opacity: 0.94;
}

.product-card-qty-btn:disabled,
.product-card-qty-btn[disabled] {
    opacity: 0.5;
    cursor: default;
}

.product-card-qty-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    font-weight: 800;
    color: #222;
}

/* =========================================================
   BADGE DE QUANTIDADE
   A quantidade já aparece no controle - / +
   ========================================================= */

.product-card-qty-badge {
    display: none !important;
}

.product-card-qty-badge.is-hidden {
    display: none !important;
}

/* =========================================================
   ESTADOS
   ========================================================= */
.product-card-store.is-store-closed .btn-add-cart,
.product-card-store .btn-add-cart.js-store-closed-action,
.product-card-store.is-store-closed .product-card-qty-btn,
.product-card-store .product-card-qty-btn[data-store-closed="1"] {
    background: #d9d9dc;
    color: #7c7c82;
    cursor: pointer;
}

.product-card-store.is-store-closed .btn-add-cart:hover,
.product-card-store .btn-add-cart.js-store-closed-action:hover,
.product-card-store.is-store-closed .product-card-qty-btn:hover,
.product-card-store .product-card-qty-btn[data-store-closed="1"]:hover {
    opacity: 1;
}

.product-card-store.is-out-of-stock {
    opacity: 0.96;
}

.product-card-store.is-out-of-stock .product-card-store-price {
    color: #b91c1c;
}

.store-product-stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    margin-top: 8px;
    text-transform: lowercase;
}

/* =========================================================
   GRUPOS DE OPÇÕES
   ========================================================= */
.product-options-group {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 10px;
}

.product-options-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.product-options-group-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-options-group-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    color: #222;
}

.product-options-group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    text-transform: lowercase;
}

.product-options-group-badge.is-required {
    background: rgba(223, 31, 38, 0.10);
    color: #c81e1e;
}

.product-options-group-badge.is-optional {
    background: rgba(21, 128, 61, 0.10);
    color: #15803d;
}

.product-options-group-badge.is-single {
    background: #f3f4f6;
    color: #334155;
}

.product-options-group-badge.is-multi {
    background: rgba(29, 78, 216, 0.10);
    color: #1d4ed8;
}

.product-options-group-subtitle {
    font-size: 12px;
    color: #df1f26;
    font-weight: 700;
    margin-top: 6px;
}

.product-options-group-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.product-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 10px;
    border: 1px solid #efefef;
    border-radius: 14px;
    cursor: pointer;
    background: #fff;
}

.product-option-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.product-option-item-main input {
    accent-color: #df1f26;
}

.product-option-item-name {
    font-size: 14px;
    color: #333;
    line-height: 1.45;
}

.product-option-item-price {
    font-size: 14px;
    color: #222;
    white-space: nowrap;
    font-weight: 800;
}

.product-options-group.has-error {
    border-color: rgba(220, 38, 38, 0.28);
}

.product-options-group-error {
    margin-top: 8px;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 700;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 640px) {
    .product-grid {
        gap: 10px;
    }

    .product-card-store-title {
        font-size: 15px;
    }

    .product-card-store-description {
        font-size: 11px;
        min-height: 30px;
    }

    .product-card-store-price {
        font-size: 20px;
    }
}

/* =========================================================
   DESCRIÇÃO DO PRODUTO / VER MAIS
   ========================================================= */

.product-card-description-wrap {
    margin-top: 6px;
}

.product-card-description {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
}

.product-card-description-wrap:not(.is-expanded) .product-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-description-wrap.is-expanded .product-card-description {
    display: block;
    overflow: visible;
}

.product-card-description-toggle {
    display: inline-flex;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #df1f26;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 800;
    cursor: pointer;
}

/* ===== SELOS DO PRODUTO NO CARD DA LOJA ===== */

.product-card-store-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.product-card-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    text-transform: lowercase;
    white-space: nowrap;
}

.product-card-store-badge i {
    font-size: 9px;
}

.product-card-store-badge.is-new {
    background: rgba(22, 163, 74, 0.10);
    color: #15803d;
}

.product-card-store-badge.is-popular {
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
}

/* ===== ATRIBUTOS DO PRODUTO (ÍCONES) ===== */
.product-card-attribute-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid #eee;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.18s ease;
    padding: 0;
}

.product-card-attribute-icon i {
    font-size: 11px;
}

/* HOVER */
.product-card-attribute-icon:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* ===== CORES POR TIPO ===== */

/* dieta */
.product-card-attribute-icon.is-diet {
    color: #16a34a;
    background: rgba(22,163,74,0.08);
}

/* restrição */
.product-card-attribute-icon.is-restriction {
    color: #059669;
    background: rgba(5,150,105,0.08);
}

/* alérgeno (mais importante visualmente) */
.product-card-attribute-icon.is-allergen {
    color: #d97706;
    background: rgba(217,119,6,0.12);
}

/* característica */
.product-card-attribute-icon.is-feature {
    color: #2563eb;
    background: rgba(37,99,235,0.08);
}

/* ajuste das telas que usam cards de produto para reduzir espaço antes do footer */
body.cliente-footer-float .cliente-main {
    padding-bottom: 70px;
}