:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --primary: #0f766e;
    --primary-dark: #0b5e58;
    --text: #1f2933;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* HEADER */
.header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.header h1 {
    font-size: 18px;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lang-switcher {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lang-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.link {
    font-size: 14px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 16px;
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
}

/* PRODUCTS */
.products {
    display: grid;
    gap: 14px;
}

/* CARD */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
}

/* IMAGE */
.img {
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* TEXT */
.card h3 {
    margin: 10px 0 6px;
    font-size: 17px;
}

.price {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.card p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--muted);
}

.min {
    font-size: 13px;
}

/* CONTROLS */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 10px;
}

/* BUTTON BASE */
.controls button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    font-size: 18px;
    touch-action: manipulation;
}

/* MINUS */
.controls .minus {
    background: #f1f5f9;
    color: var(--text);
}

/* PLUS */
.controls .plus {
    background: var(--primary);
    color: white;
}

/* ACTIVE (mobile instead of hover) */
.controls .plus:active {
    background: var(--primary-dark);
    transform: scale(0.96);
}

.controls .minus:active {
    background: #e5e7eb;
    transform: scale(0.96);
}

.controls span {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

/* SUMMARY */
.summary {
    margin-top: 20px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.summary h2 {
    margin-top: 0;
    font-size: 16px;
}

#summaryList {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* WHATSAPP BUTTON */
#whatsappBtn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 16px;
    touch-action: manipulation;
}

#whatsappBtn:active {
    transform: scale(0.98);
    background: var(--primary-dark);
}

#whatsappBtn:disabled {
    background: #cbd5e1;
}

.brspan {
    display: block;
    height: 250px;
}

/* RTL support */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-actions {
    justify-content: flex-start;
}

html[dir="rtl"] .link {
    text-align: right;
}

html[dir="rtl"] .card,
html[dir="rtl"] .summary {
    text-align: right;
}

/* TABLET */
@media (min-width: 768px) {
    .container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 20px;
        padding: 24px;
    }

    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* DESKTOP */
@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}