/* ========================================
   E.C. ITARARÉ — Design System & Landing Page
   Fonte: Montserrat | Cor: Vermelho Itararé
   Tema: Branco com vermelho
   ======================================== */

/* ---- CSS Variables ---- */
:root {
    --primary: #C41E24;
    --primary-dark: #9A1118;
    --primary-light: #E84C52;
    --primary-glow: rgba(196, 30, 36, 0.15);
    --primary-subtle: rgba(196, 30, 36, 0.06);

    --bg: #FFFFFF;
    --bg-card: #F7F7F8;
    --bg-card-hover: #F0F0F2;
    --bg-input: #F5F5F6;
    --bg-glass: rgba(255, 255, 255, 0.9);

    --text: #1A1A1A;
    --text-secondary: #555555;
    --text-muted: #888888;

    --border: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.12);

    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;

    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 4px 20px rgba(196, 30, 36, 0.15);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Montserrat', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ---- Material Icons ---- */
.material-icons {
    font-size: inherit;
    vertical-align: middle;
    line-height: 1;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.2s; }
.animate-in:nth-child(4) { animation-delay: 0.3s; }

/* ---- Header ---- */
.header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px 20px;
    animation: fadeIn 0.8s ease-out;
}

.header__escudo {
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    filter: drop-shadow(0 2px 8px rgba(196, 30, 36, 0.25));
}

.header__title {
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 4px;
}

.header__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---- Container ---- */
.container {
    position: relative;
    z-index: 5;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Section ---- */
.section {
    margin-bottom: 32px;
}

.section__title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section__title .material-icons {
    color: var(--primary);
    font-size: 1.2rem;
}

/* ---- Product Cards ---- */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.product-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-glow);
}

.product-card.selected::after {
    content: 'check';
    font-family: 'Material Icons';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    color: #fff;
    z-index: 2;
    animation: fadeIn 0.3s ease;
}

.product-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f5f5f5;
    transition: var(--transition);
}

.product-card:hover .product-card__img {
    transform: scale(1.03);
}

.product-card__info {
    padding: 10px 12px;
}

.product-card__name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.product-card__price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
}

/* ---- Delivery Info Banner ---- */
.delivery-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.delivery-banner__icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.delivery-banner__icon .material-icons {
    font-size: 1.6rem;
}

.delivery-banner__text {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.delivery-banner__date {
    font-size: 1rem;
    font-weight: 800;
    display: block;
    margin-top: 4px;
}

/* ---- How It Works ---- */
.steps {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.steps::-webkit-scrollbar {
    display: none;
}

.step-card {
    min-width: 130px;
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
}

.step-card__number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    margin: 0 auto 8px;
}

.step-card__title {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.step-card__desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ---- Form ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.95rem;
    font-family: var(--font);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-input {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ---- Order Items ---- */
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.order-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-item__title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-item__remove {
    width: 28px;
    height: 28px;
    background: rgba(220, 38, 38, 0.08);
    border: none;
    border-radius: 50%;
    color: var(--danger);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.order-item__remove:hover {
    background: var(--danger);
    color: #fff;
}

.order-item__fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.order-item__fields .form-group {
    margin-bottom: 0;
}

.order-item__fields .form-label {
    font-size: 0.7rem;
    margin-bottom: 4px;
}

.order-item__fields .form-input {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.btn-add-item {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ---- Order Summary ---- */
.order-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}

.order-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.85rem;
}

.order-summary__row + .order-summary__row {
    border-top: 1px solid var(--border);
}

.order-summary__label {
    color: var(--text-secondary);
    font-weight: 500;
}

.order-summary__value {
    font-weight: 700;
}

.order-summary__total {
    font-size: 1.1rem;
    color: var(--primary);
}

.order-summary__deposit {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    margin: 12px -20px -20px;
    padding: 16px 20px;
    border-radius: 0 0 var(--radius) var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.order-summary__deposit-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.order-summary__deposit-value {
    font-size: 1.3rem;
    font-weight: 800;
}

/* ---- Pix Payment Section ---- */
.pix-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
}

.pix-section__icon {
    margin-bottom: 12px;
}

.pix-section__icon svg {
    width: 48px;
    height: 48px;
}

.pix-section__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.pix-section__desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pix-key-box {
    background: var(--bg);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.pix-key-box__value {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    word-break: break-all;
    text-align: left;
    color: var(--text);
}

.pix-key-box__label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: left;
    margin-bottom: 2px;
}

.btn-copy {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-xs);
    color: #fff;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-copy:hover {
    background: var(--primary-dark);
}

.btn-copy.copied {
    background: var(--success);
}

.pix-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ---- Buttons ---- */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.btn-whatsapp:hover {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

/* ---- Success State ---- */
.success-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.success-overlay.active {
    display: flex;
}

.success-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    animation: fadeInUp 0.5s ease-out;
    box-shadow: var(--shadow-lg);
}

.success-card__icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--success);
}

.success-card__title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 8px;
}

.success-card__code {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 12px 0;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-xs);
}

.success-card__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text);
    z-index: 200;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 30px 20px 40px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- Size Guide Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    max-width: 420px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease-out;
    box-shadow: var(--shadow-lg);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal__close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal__close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.modal__body {
    padding: 20px;
}

.size-guide-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.size-guide-item:last-child { border-bottom: none; }

.size-guide-item__name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 50px;
}

.size-guide-item__desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.size-guide-img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-top: 12px;
}

/* ---- Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Quantity Control ---- */
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: var(--font);
}

.qty-btn:hover { background: var(--primary); color: #fff; }

.qty-value {
    width: 40px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--bg);
    border: none;
    color: var(--text);
    font-family: var(--font);
    height: 36px;
}

/* ---- Image Zoom Modal ---- */
.img-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 150;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.img-zoom-overlay.active { display: flex; }

.img-zoom-overlay img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
}

/* ---- Responsive ---- */
@media (min-width: 520px) {
    .container { max-width: 520px; }
    .header__title { font-size: 1.6rem; }
    .products-grid { gap: 16px; }
}

@media (min-width: 768px) {
    .container { max-width: 600px; }
    .header { padding: 60px 20px 30px; }
    .header__escudo { width: 110px; height: 110px; }
    .header__title { font-size: 1.8rem; }
}
