/* ============================================
   ROJO MALBEC BLEND BUILDER - STYLES
   Design System: Wine Red + Cream + Kraft
   ============================================ */

:root {
    --wine: #722F37;
    --wine-dark: #4a1c20;
    --wine-light: #9a4850;
    --cream: #FDFCF8;
    --kraft: #D2B48C;
    --kraft-light: #E8DCC8;
    --gold: #C9A227;
    --text: #2c1e1a;
    --text-light: #666;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Montserrat', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--cream);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--wine) 0%, var(--wine-dark) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
    display: none;
    padding: 20px;
    padding-bottom: 100px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.screen-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--wine);
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--kraft-light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   HOME SCREEN
   ============================================ */
.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--wine);
    margin-bottom: 10px;
}

.welcome-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.category-card {
    background: var(--kraft-light);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.category-card:hover,
.category-card:active {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.category-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--wine) 0%, var(--wine-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(114, 47, 55, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    color: var(--wine);
    border: 2px solid var(--wine);
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-whatsapp {
    width: 100%;
    padding: 18px 24px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.filters-row::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--kraft-light);
    border: none;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip.active {
    background: var(--wine);
    color: white;
}

/* ============================================
   INGREDIENTS GRID
   ============================================ */
.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ingredient-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ingredient-card:active {
    transform: scale(0.98);
}

.ingredient-card.selected {
    border: 3px solid var(--wine);
}

.ingredient-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: var(--kraft-light);
}

.ingredient-info {
    padding: 12px;
}

.ingredient-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.ingredient-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--kraft-light);
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--text-light);
}

/* ============================================
   BLEND LIST
   ============================================ */
.blend-container {
    min-height: 300px;
}

.blend-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.blend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
}

.blend-item-icon {
    font-size: 1.5rem;
}

.blend-item-name {
    flex: 1;
    font-weight: 500;
}

.blend-item-remove {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
}

.blend-summary {
    margin-top: 20px;
    padding: 15px;
    background: var(--kraft-light);
    border-radius: var(--radius);
}

.summary-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.profile-tag {
    padding: 4px 10px;
    background: var(--wine);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* ============================================
   ORDER FORM
   ============================================ */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px;
    border: 2px solid var(--kraft-light);
    border-radius: var(--radius);
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--wine);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.selected-ingredients {
    background: var(--kraft-light);
    padding: 15px;
    border-radius: var(--radius);
}

.selected-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
    align-items: flex-end;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 25px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 2.5rem;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--wine);
}

.modal-section {
    margin-bottom: 15px;
}

.modal-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 5px;
}

.modal-value {
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.modal-add {
    margin-top: 20px;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 25px;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    position: relative;
    padding: 5px;
}

.nav-item.active {
    color: var(--wine);
}

.nav-icon {
    font-size: 1.3rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-badge {
    position: absolute;
    top: 0;
    right: 25%;
    background: var(--wine);
    color: white;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.nav-badge:empty,
.nav-badge[data-count="0"] {
    display: none;
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   LABEL SECTION (in Order Form)
   ============================================ */
.label-section {
    background: linear-gradient(135deg, var(--kraft-light) 0%, #f5efe6 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin: 10px 0;
    border: 2px dashed var(--kraft);
}

.label-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.label-section-header .label-icon {
    font-size: 1.5rem;
}

.label-section-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--wine);
    margin: 0;
}

.label-example {
    text-align: center;
    margin-bottom: 20px;
}

.label-example-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
}

.label-example-text {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.label-section .form-group {
    margin-bottom: 15px;
}

.label-section .form-group:last-child {
    margin-bottom: 0;
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-card:hover,
.product-card:active {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.product-image-container {
    width: 100%;
    height: 120px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-emoji {
    font-size: 2.5rem;
}

.product-info {
    width: 100%;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--text);
    line-height: 1.2;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .product-tagline {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.3;
}

.vital-indicator {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* Product Modal */
.product-modal-content {
    position: relative;
}

.product-modal-content .modal-header {
    flex-direction: column;
    text-align: center;
    gap: 8px;
}

.product-modal-content .modal-icon {
    font-size: 3rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.product-modal-content .product-tagline {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.vital-badge {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius);
    color: #2e7d32;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}