/* ==========================================================================
   AppDelivery - Estilos do front-end
   As variáveis --appd-* são sobrescritas via inline style com as cores
   configuradas no painel administrativo.
   ========================================================================== */

:root {
    --appd-primary: #f5b400;
    --appd-secondary: #1c1f22;
    --appd-text: #1f2933;
    --appd-bg: #ffffff;
    --appd-btn-text: #1c1f22;
    --appd-border-radius: 14px;
    --appd-card-bg: #f7f9fb;
    --appd-border-color: #e3e8ee;

    --appd-topbar-bg: #1c1f22;
    --appd-topbar-text: #f5f5f5;
    --appd-topbar-muted: #9aa0a6;
    --appd-topbar-border: #2e3236;
    --appd-pill-bg: #2a2d31;
}

.appd-wrapper.appd-theme-light {
    --appd-topbar-bg: #ffffff;
    --appd-topbar-text: #1f2933;
    --appd-topbar-muted: #6b7280;
    --appd-topbar-border: #e3e8ee;
    --appd-pill-bg: #f1f3f5;
    --appd-card-bg: #f7f9fb;
    --appd-bg: #ffffff;
    --appd-text: #1f2933;
}

.appd-wrapper.appd-theme-dark {
    --appd-bg: #15181a;
    --appd-text: #f0f0f0;
    --appd-card-bg: #21252a;
    --appd-border-color: #32373d;
    --appd-topbar-bg: #1c1f22;
    --appd-topbar-text: #f5f5f5;
    --appd-topbar-muted: #9aa0a6;
    --appd-topbar-border: #2e3236;
    --appd-pill-bg: #2a2d31;
}

.appd-wrapper * {
    box-sizing: border-box;
}

.appd-wrapper {
    max-width: 1220px;
    margin: 0 auto;
    background: var(--appd-bg);
    color: var(--appd-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 24px;
    border-radius: var(--appd-border-radius);
}

/* ------------------------------------------------------------------
 * Topbar
 * ------------------------------------------------------------------ */
.appd-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--appd-topbar-bg);
    color: var(--appd-topbar-text);
    border-radius: 12px;
    padding: 12px 16px;
    margin: -24px -24px 16px;
    border-bottom: 1px solid var(--appd-topbar-border);
}

.appd-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.appd-logo img {
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--appd-primary);
    display: block;
}

.appd-topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--appd-topbar-text);
}

.appd-topbar-search {
    flex: 1 1 240px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--appd-pill-bg);
    border: 1px solid var(--appd-topbar-border);
    border-radius: 50px;
    padding: 9px 16px;
    color: var(--appd-topbar-muted);
    min-width: 160px;
}

.appd-topbar-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--appd-topbar-text);
    width: 100%;
    font-size: 0.92rem;
    padding: 0;
}

.appd-topbar-search input::placeholder {
    color: var(--appd-topbar-muted);
}

.appd-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
    flex-wrap: wrap;
}

.appd-info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 50px;
    background: var(--appd-pill-bg);
    color: var(--appd-topbar-muted);
    white-space: nowrap;
}

.appd-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
}

.appd-status-open {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.appd-status-closed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.appd-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.appd-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--appd-topbar-text);
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
    text-decoration: none;
}

.appd-icon-btn:hover {
    background: var(--appd-pill-bg);
}

.appd-cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 50px;
    min-width: 16px;
    text-align: center;
}

.form-whatsapp .btn-enviar {
    background-color: #25D366; /* Cor do WhatsApp */
    color: #ffffff; /* Cor do texto */
    border-radius: 5px;
}

/* Tema claro/escuro - alternância de ícones */
.appd-wrapper.appd-theme-light #appd-theme-toggle .appd-icon-moon { display: none; }
.appd-wrapper.appd-theme-light #appd-theme-toggle .appd-icon-sun { display: block !important; }
.appd-wrapper:not(.appd-theme-light) #appd-theme-toggle .appd-icon-sun { display: none; }

/* ------------------------------------------------------------------
 * Descrição da loja, redes sociais, horários
 * ------------------------------------------------------------------ */
.appd-store-description {
    margin: 0 0 12px;
    font-size: 0.95rem;
    opacity: 0.75;
}

.appd-social-links {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.appd-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--appd-card-bg);
    color: var(--appd-secondary);
    transition: transform 0.15s ease, background 0.15s ease;
}

.appd-social-link:hover {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    transform: translateY(-2px);
}

.appd-hours-panel {
    background: var(--appd-card-bg);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.appd-hours-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.appd-hours-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--appd-border-color);
}

.appd-hours-item:last-child {
    border-bottom: none;
}

/* ------------------------------------------------------------------
 * Filtros de categoria
 * ------------------------------------------------------------------ */
.appd-category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: thin;
}

.appd-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 50px;
    border: 1px solid var(--appd-border-color);
    background: var(--appd-card-bg);
    color: var(--appd-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.appd-category-pill.is-active {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border-color: var(--appd-primary);
}

.appd-category-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ------------------------------------------------------------------
 * Produtos
 * ------------------------------------------------------------------ */
.appd-category-section {
    margin-bottom: 28px;
}

.appd-category-section.is-hidden {
    display: none;
}

.appd-category-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--appd-primary);
    display: inline-block;
}

.appd-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(274px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.appd-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--appd-card-bg);
    border: 1px solid var(--appd-border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.appd-product-card.is-hidden {
    display: none;
}

.appd-product-card:hover {
    border-color: var(--appd-primary);
}

.appd-product-card.is-unavailable {
    opacity: 0.65;
}

.appd-product-image {
    display: block;
    width: 100%;
    height: 184px;
    border: none;
    padding: 0;
    background: var(--appd-border-color);
    cursor: zoom-in;
    position: relative;
}

.appd-product-image img {
    width: 100%;
    height: 184px;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.appd-product-image-btn:hover img {
    transform: scale(1.04);
}

.appd-unavailable-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    z-index: 1;
}

.appd-unavailable-badge-noimg {
    position: static;
    display: inline-block;
    margin: 12px 12px 0;
}

.appd-product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    flex: 1 1 auto;
}

.appd-product-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.appd-product-description {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.75;
    line-height: 1.4;
    flex: 1 1 auto;
}

.appd-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

.appd-product-price {
    font-weight: 700;
    color: var(--appd-text);
    font-size: 1.02rem;
}

.appd-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border: none;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
    white-space: nowrap;
}

.appd-add-btn:hover {
    filter: brightness(0.92);
}

.appd-add-btn:disabled {
    background: var(--appd-border-color);
    color: var(--appd-topbar-muted);
    cursor: not-allowed;
}

.appd-empty-message {
    opacity: 0.7;
    font-style: italic;
}

/* ==========================================================================
   Overlay, Modais, Drawers
   ========================================================================== */

.appd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* ------------------------------------------------------------------
 * Modais (genérico)
 * ------------------------------------------------------------------ */
.appd-modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.appd-modal.is-open {
    display: flex;
}

.appd-modal-content {
    position: relative;
    background: var(--appd-bg);
    color: var(--appd-text);
    border-radius: 14px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
}

.appd-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: var(--appd-card-bg);
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--appd-text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    z-index: 2;
}

/* Modal de imagem */
.appd-image-modal-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.appd-image-modal-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    object-fit: contain;
}

.appd-image-modal-title {
    margin: 12px 0 0;
    font-weight: 700;
    text-align: center;
}

/* ------------------------------------------------------------------
 * Modal de personalização do produto
 * ------------------------------------------------------------------ */
.appd-product-modal-content {
    width: 520px;
    max-width: 92vw;
    padding: 0;
}

.appd-product-modal-body {
    display: flex;
    flex-direction: column;
}

.appd-pm-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.appd-pm-header {
    padding: 16px 20px 8px;
}

.appd-pm-name {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
}

.appd-pm-description {
    margin: 0 0 6px;
    font-size: 0.9rem;
    opacity: 0.75;
    line-height: 1.4;
}

.appd-pm-price {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--appd-text);
}

.appd-pm-groups {
    padding: 4px 20px;
}

.appd-pm-group {
    padding: 14px 0;
    border-top: 1px solid var(--appd-border-color);
}

.appd-pm-group-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.appd-pm-group-name {
    font-weight: 700;
    font-size: 0.98rem;
}

.appd-pm-group-meta {
    font-size: 0.78rem;
    opacity: 0.7;
    white-space: nowrap;
}

.appd-pm-group-required {
    color: var(--appd-primary);
    font-weight: 700;
}

.appd-pm-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.appd-pm-option.is-unavailable {
    opacity: 0.5;
}

.appd-pm-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--appd-primary);
    flex-shrink: 0;
}

.appd-pm-option-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.appd-pm-option-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.appd-pm-option-description {
    font-size: 0.8rem;
    opacity: 0.7;
}

.appd-pm-option-price {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.appd-pm-option-unavailable-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
}

.appd-pm-observation {
    padding: 14px 20px;
    border-top: 1px solid var(--appd-border-color);
}

.appd-pm-observation textarea {
    width: 100%;
    min-height: 64px;
}

.appd-pm-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--appd-border-color);
    position: sticky;
    bottom: 0;
    background: var(--appd-bg);
}

.appd-pm-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.appd-pm-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--appd-border-color);
    background: var(--appd-bg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--appd-text);
}

.appd-pm-qty-btn:hover {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
}

.appd-pm-qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.appd-pm-add-btn {
    flex: 0 1 300px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.appd-pm-add-btn:hover {
    filter: brightness(0.95);
}

.appd-pm-error {
    color: #ef4444;
    font-size: 0.8rem;
    padding: 0 20px 10px;
    margin: 0;
}

/* ------------------------------------------------------------------
 * Drawers (carrinho e checkout)
 * ------------------------------------------------------------------ */
.appd-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    background: var(--appd-bg);
    color: var(--appd-text);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
}

.appd-drawer.is-open {
    transform: translateX(0);
}

.appd-drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--appd-border-color);
}

.appd-drawer-header h2 {
    margin: 0;
    font-size: 1.1rem;
    flex: 1 1 auto;
}

.appd-drawer-close,
.appd-drawer-back {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--appd-text);
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
}

.appd-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 20px;
}

.appd-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--appd-border-color);
    background: var(--appd-bg);
}

.appd-cart-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 4px 0;
}

.appd-total-line {
    font-size: 1.05rem;
    margin-bottom: 10px;
}

/* Itens do carrinho */
.appd-cart-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--appd-border-color);
}

.appd-cart-item:last-child {
    border-bottom: none;
}

.appd-cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--appd-card-bg);
}

.appd-cart-item-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.appd-cart-item-name {
    font-weight: 700;
    font-size: 0.92rem;
}

.appd-cart-item-options {
    font-size: 0.78rem;
    opacity: 0.7;
    line-height: 1.4;
}

.appd-cart-item-obs {
    font-size: 0.78rem;
    opacity: 0.6;
    font-style: italic;
}

.appd-cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.appd-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.appd-cart-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--appd-border-color);
    background: var(--appd-bg);
    font-weight: 700;
    cursor: pointer;
    color: var(--appd-text);
    font-size: 0.9rem;
}

.appd-cart-qty-btn:hover {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
}

.appd-cart-qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.appd-cart-item-price {
    font-weight: 700;
    font-size: 0.92rem;
}

.appd-cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.78rem;
    text-decoration: underline;
    padding: 0;
}

.appd-cart-checkout-btn,
.appd-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.appd-cart-checkout-btn:hover,
.appd-submit-btn:hover {
    filter: brightness(0.95);
}

.appd-cart-checkout-btn:active,
.appd-submit-btn:active {
    transform: scale(0.99);
}

.appd-cart-checkout-btn:disabled,
.appd-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.appd-submit-btn {
    margin-bottom: 10px;
}

/* ------------------------------------------------------------------
 * Formulário de checkout
 * ------------------------------------------------------------------ */
.appd-checkout-section {
    margin-bottom: 20px;
}

.appd-checkout-section[data-order-type] {
    display: none;
}

.appd-checkout-section[data-order-type].is-active {
    display: block;
}

.appd-checkout-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.appd-field,
.appd-field-row > .appd-field {
    margin-bottom: 12px;
}

.appd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.appd-field-cep {
    grid-template-columns: unset;
}

.appd-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.88rem;
}

.appd-required {
    color: #ef4444;
}

.appd-wrapper input[type="text"],
.appd-wrapper input[type="tel"],
.appd-wrapper input[type="email"],
.appd-wrapper input[type="number"],
.appd-wrapper select,
.appd-wrapper textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--appd-border-color);
    border-radius: 10px;
    font-size: 0.92rem;
    background: var(--appd-bg);
    color: var(--appd-text);
}

.appd-wrapper input:focus,
.appd-wrapper select:focus,
.appd-wrapper textarea:focus {
    outline: none;
    border-color: var(--appd-primary);
    box-shadow: 0 0 0 3px rgba(245, 180, 0, 0.15);
}

.appd-wrapper textarea {
    min-height: 70px;
    resize: vertical;
}

.appd-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    cursor: pointer;
}

.appd-checkbox-label input {
    width: auto;
    accent-color: var(--appd-primary);
}

.appd-cep-status {
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
    min-height: 14px;
}

.appd-cep-status.is-loading { color: var(--appd-secondary); }
.appd-cep-status.is-error { color: #ef4444; }
.appd-cep-status.is-success { color: #16a34a; }

.appd-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Tipo de pedido */
.appd-order-type-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.appd-order-type-pill,
.appd-payment-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 50px;
    border: 1px solid var(--appd-border-color);
    background: var(--appd-card-bg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.appd-order-type-pill input,
.appd-payment-pill input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.appd-order-type-pill:has(input:checked),
.appd-payment-pill:has(input:checked) {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border-color: var(--appd-primary);
}

.appd-order-type-icon,
.appd-payment-icon {
    font-size: 1rem;
}

.appd-payment-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Cupom */
.appd-coupon-row {
    display: flex;
    gap: 8px;
}

.appd-coupon-row input {
    flex: 1 1 auto;
}

.appd-coupon-apply-btn {
    flex-shrink: 0;
    background: var(--appd-secondary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
}

.appd-coupon-apply-btn:hover {
    filter: brightness(1.15);
}

.appd-coupon-message {
    margin: 8px 0 0;
    font-size: 0.82rem;
    min-height: 16px;
}

.appd-coupon-message.is-error { color: #ef4444; }
.appd-coupon-message.is-success { color: #16a34a; }

/* Resumo do pedido (dentro do checkout) */
.appd-summary-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appd-summary-line-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 4px 0;
    border-bottom: 1px dashed var(--appd-border-color);
}

.appd-summary-line-item:last-child {
    border-bottom: none;
}

.appd-summary-line-total {
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--appd-border-color);
    margin-top: 4px;
    padding-top: 8px;
}

.appd-summary-line-discount {
    color: #16a34a;
}

/* ------------------------------------------------------------------
 * Toast
 * ------------------------------------------------------------------ */
.appd-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--appd-secondary);
    color: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.appd-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Página de Rastreamento de Pedido
   ========================================================================== */
.appd-track-wrapper {
    display: flex;
    flex-direction: column;
}

.appd-track-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    padding: 40px 0;
}

.appd-track-card {
    width: 100%;
    max-width: 480px;
    background: var(--appd-card-bg);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
}

.appd-track-title {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 800;
}

.appd-track-subtitle {
    margin: 0 0 20px;
    opacity: 0.75;
    font-size: 0.92rem;
}

.appd-track-input-row {
    display: flex;
    align-items: center;
    background: var(--appd-bg);
    border: 1px solid var(--appd-border-color);
    border-radius: 50px;
    overflow: hidden;
    padding-left: 16px;
}

.appd-track-hash {
    font-weight: 700;
    opacity: 0.6;
    margin-right: 4px;
}

.appd-track-input-row input {
    flex: 1 1 auto;
    border: none;
    padding: 12px 8px;
    font-size: 1rem;
    background: transparent;
    color: var(--appd-text);
    outline: none;
}

.appd-track-submit-btn {
    background: var(--appd-primary);
    color: var(--appd-btn-text);
    border: none;
    padding: 14px 24px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.92rem;
    border-radius: 0 50px 50px 0;
}

.appd-track-submit-btn:hover {
    filter: brightness(0.95);
}

.appd-track-result {
    margin-top: 28px;
    text-align: left;
}

.appd-track-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.appd-track-result-number {
    font-weight: 800;
    font-size: 1.2rem;
}

.appd-track-result-total {
    font-weight: 700;
    color: var(--appd-text);
}

.appd-track-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.appd-track-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    position: relative;
    opacity: 0.45;
}

.appd-track-step.is-done {
    opacity: 1;
}

.appd-track-step:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 32px;
    bottom: -10px;
    width: 2px;
    background: var(--appd-border-color);
}

.appd-track-step.is-done:not(:last-child)::before {
    background: var(--appd-primary);
}

.appd-track-step-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--appd-border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.appd-track-step.is-done .appd-track-step-dot {
    background: var(--appd-primary);
}

.appd-track-step.is-current .appd-track-step-dot {
    box-shadow: 0 0 0 4px rgba(245, 180, 0, 0.25);
}

.appd-track-step-label {
    font-weight: 600;
    font-size: 0.94rem;
}

.appd-track-cancelled-message {
    margin-top: 14px;
    color: #ef4444;
    font-weight: 700;
    text-align: center;
}

.appd-track-error {
    margin-top: 16px;
    color: #ef4444;
    font-weight: 600;
    font-size: 0.9rem;
}


/* Grade fixa: 04 produtos por linha no desktop, mantendo responsivo no mobile */
@media (max-width: 1099px) and (min-width: 701px) {
    .appd-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .appd-products-grid {
        grid-template-columns: 1fr;
    }

    .appd-product-image,
    .appd-product-image img {
        height: 184px;
    }

    .appd-pm-footer {
        flex-direction: column;
        align-items: center;
    }

    .appd-pm-add-btn {
        width: 100%;
        max-width: 320px;
    }
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 600px) {
    .appd-wrapper {
        padding: 16px;
    }

    .appd-topbar {
        margin: -16px -16px 16px;
        border-radius: 0;
    }

    .appd-topbar-search {
        order: 3;
        flex: 1 1 100%;
    }

    .appd-field-row {
        grid-template-columns: 1fr;
    }

    .appd-products-grid {
        grid-template-columns: 1fr;
    }

    .appd-drawer {
        max-width: 100%;
    }

    .appd-product-modal-content {
        width: 100%;
    }
}


/* Banner slider superior */
.appd-hero-slider {
    position: relative;
    width: 100%;
    margin: 18px 0 22px;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(17, 24, 39, .06);
    box-shadow: 0 14px 35px rgba(15, 23, 42, .12);
}
.appd-hero-slides {
    position: relative;
    min-height: 180px;
}
.appd-hero-slide {
    width: 100%;
}
.appd-hero-slide img {
    display: block;
    width: 100%;
    height: clamp(180px, 28vw, 360px);
    object-fit: cover;
}
.appd-hero-slides.has-two-slides .appd-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: appdHeroFade 8s infinite;
}
.appd-hero-slides.has-two-slides .appd-hero-slide:first-child {
    position: relative;
    opacity: 1;
}
.appd-hero-slides.has-two-slides .appd-hero-slide:nth-child(2) {
    animation-delay: 4s;
}
@keyframes appdHeroFade {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0; }
    100% { opacity: 1; }
}
.appd-hero-text {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    max-width: 680px;
    padding: 14px 18px;
    border-radius: 16px;
    color: #fff;
    font-size: clamp(18px, 2.2vw, 30px);
    font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.18));
    text-shadow: 0 2px 8px rgba(0,0,0,.45);
}

@media (max-width: 1240px) {
    .appd-products-grid {
        grid-template-columns: repeat(3, minmax(240px, 1fr));
    }
}

@media (max-width: 900px) {
    .appd-products-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .appd-hero-slider { border-radius: 16px; margin: 14px 0 18px; }
    .appd-hero-slide img { height: 170px; }
    .appd-hero-text { left: 12px; right: 12px; bottom: 12px; padding: 10px 12px; }
}

/* Ajuste: exibir 4 produtos por linha em telas grandes */
@media (min-width: 1100px) {
    .appd-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Login no topo, após o carrinho */
.appd-login-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--appd-border-color);
    border-radius: 999px;
    background: var(--appd-card-bg);
    color: var(--appd-text-color);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.appd-login-top-btn:hover {
    border-color: var(--appd-primary);
    color: var(--appd-primary);
}

.appd-login-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--appd-primary) 14%, transparent);
    color: var(--appd-primary);
    font-size: 0.84rem;
    font-weight: 800;
}

.appd-login-drawer .login-username,
.appd-login-drawer .login-password,
.appd-login-drawer .login-remember {
    margin: 0 0 14px;
}

.appd-login-drawer label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.appd-login-drawer input[type="text"],
.appd-login-drawer input[type="password"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--appd-border-color);
    border-radius: 10px;
    background: var(--appd-input-bg, #fff);
    color: var(--appd-text-color);
}

.appd-login-drawer .login-submit input,
.appd-login-logout {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--appd-primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.appd-login-hint,
.appd-login-welcome p {
    color: var(--appd-muted-color);
    margin-top: 0;
}

.appd-login-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.appd-login-links a {
    color: var(--appd-primary);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 640px) {
    .appd-login-text {
        display: none;
    }
    .appd-login-top-btn {
        padding: 6px;
        min-width: 38px;
        justify-content: center;
    }
}

/* Ajuste final solicitado: 4 itens no desktop, imagem 274x184 e mobile em 1 coluna */
@media (min-width: 1100px) {
    .appd-products-grid {
        grid-template-columns: repeat(4, minmax(274px, 1fr));
    }
}

@media (max-width: 700px) {
    .appd-products-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================================================================
   Layout tipo aplicativo: cards amplos, imagem sem sobrepor texto e carrinho no rodapé
   ====================================================================== */
.appd-wrapper {
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    padding: 0 28px 112px;
    border-radius: 0;
    background: #ffffff;
}

.appd-topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    margin: 0 -28px 20px;
    padding: 14px 28px;
    border-radius: 0;
    background: #ef1f2d;
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .18);
}

.appd-topbar-title {
    color: #ffffff;
    font-size: clamp(1.35rem, 2.4vw, 2.15rem);
    font-weight: 900;
}

.appd-topbar-search,
.appd-info-pill,
.appd-status-pill,
.appd-icon-btn,
.appd-login-top-btn {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.22);
    color: #ffffff;
}

.appd-topbar-search input,
.appd-topbar-search input::placeholder {
    color: #ffffff;
}

.appd-category-filters {
    position: sticky;
    top: 68px;
    z-index: 70;
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 0 -28px 28px;
    padding: 18px 28px;
    overflow-x: auto;
    background: #ffffff;
    border-bottom: 1px solid #eef0f4;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.appd-category-pill {
    border: 0;
    background: transparent;
    color: #4b5563;
    font-weight: 800;
    border-radius: 14px;
    padding: 10px 14px;
    white-space: nowrap;
}

.appd-category-pill.is-active,
.appd-category-pill:hover {
    background: #ef1f2d;
    color: #ffffff;
}

.appd-category-title {
    display: none;
}

.appd-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(274px, 1fr));
    gap: 26px;
    align-items: stretch;
}

.appd-product-card {
    min-height: 386px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e8edf3;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.appd-product-card:hover {
    transform: translateY(-2px);
    border-color: #ef1f2d;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
}

.appd-product-image {
    width: 100%;
    height: 184px;
    min-height: 184px;
    background: linear-gradient(180deg, #f3f6fa 0%, #ffffff 100%);
    cursor: pointer;
    overflow: hidden;
}

.appd-product-image img {
    width: 100%;
    height: 184px;
    max-height: 184px;
    object-fit: contain;
    object-position: center;
    display: block;
    padding: 8px;
}

.appd-product-info {
    padding: 28px 16px 16px;
    gap: 12px;
}

.appd-product-name {
    font-size: 1.02rem;
    font-weight: 900;
    color: #111827;
}

.appd-product-description {
    min-height: 46px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    color: #4b5563;
    opacity: 1;
}

.appd-product-footer {
    margin-top: auto;
    padding-top: 14px;
}

.appd-product-price {
    color: #ef1f2d;
    font-size: 1.05rem;
    font-weight: 900;
}

.appd-add-btn {
    background: #f5b400;
    color: #111827;
    min-height: 40px;
    padding: 10px 18px;
    border-radius: 999px;
}

.appd-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    min-height: 76px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 10px clamp(12px, 4vw, 80px);
    background: rgba(255,255,255,.98);
    border-top: 1px solid #e8edf3;
    box-shadow: 0 -6px 22px rgba(15, 23, 42, .08);
}

.appd-bottom-item,
.appd-bottom-cart {
    border: 0;
    background: transparent;
    color: #374151;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 800;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    cursor: pointer;
}

.appd-bottom-item.is-active {
    color: #ef1f2d;
}

.appd-bottom-item.is-disabled {
    opacity: .45;
    cursor: default;
}

.appd-bottom-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.appd-bottom-cart {
    min-width: 220px;
    min-height: 56px;
    padding: 0 26px;
    border-radius: 999px;
    color: #ffffff;
    background: #ef1f2d;
    box-shadow: 0 7px 18px rgba(239, 31, 45, .28);
    flex-direction: row;
    font-size: .98rem;
}

.appd-bottom-cart-icon {
    font-size: 1.18rem;
}

@media (max-width: 1240px) {
    .appd-products-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); }
}

@media (max-width: 900px) {
    .appd-wrapper { padding: 0 14px 104px; }
    .appd-topbar { margin: 0 -14px 16px; padding: 12px 14px; }
    .appd-category-filters { margin: 0 -14px 20px; padding: 14px; top: 64px; }
    .appd-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .appd-bottom-nav { padding: 8px 10px; }
    .appd-bottom-cart { width: min(420px, 92vw); }
}

@media (max-width: 640px) {
    .appd-products-grid { grid-template-columns: 1fr; }
    .appd-product-card { min-height: auto; }
    .appd-product-image,
    .appd-product-image img { height: 184px; }
    .appd-bottom-item span:last-child { font-size: .75rem; }
}