:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --insecticida-color: #10b981; /* Emerald */
    --rodenticida-color: #f59e0b; /* Amber */
    --glass-blur: blur(12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 90px; /* Space for FAB */
}

#app {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}

/* Header & Search */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

h1 i {
    color: var(--accent-color);
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Main Content */
main {
    padding: 20px;
}

.category-section {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-title.insecticidas-title i { color: var(--insecticida-color); }
.category-title.rodenticidas-title i { color: var(--rodenticida-color); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100%, 1px));
    gap: 15px;
}

/* Glass Card */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.product-card:active {
    transform: scale(0.98);
}

.card-image-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    object-fit: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-info {
    flex-grow: 1;
    overflow: hidden;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge-insecticidas {
    background: rgba(16, 185, 129, 0.1);
    color: var(--insecticida-color);
}
.badge-rodenticidas {
    background: rgba(245, 158, 11, 0.1);
    color: var(--rodenticida-color);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 50;
    transition: transform 0.2s, background 0.2s;
}

.fab:active {
    transform: scale(0.9);
    background: var(--accent-hover);
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--accent-color);
}

.form-group select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 30px;
}

.btn-primary {
    flex: 1;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:active {
    background: var(--accent-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}

.btn-danger:active {
    background: rgba(239, 68, 68, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-color);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--card-border);
    padding: 30px 20px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    overflow-y: auto;
    position: relative;
    scrollbar-width: none;
}
.modal-content::-webkit-scrollbar { display: none; }

.modal.show .modal-content {
    transform: translateY(0);
}

/* Modal Actions */
.modal-top-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Content Styles */
.detail-image-container {
    width: 100%;
    height: 250px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--card-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    margin-top: 30px;
}

.detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.image-placeholder {
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.image-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

.attach-btn-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 5;
}

.attach-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="file"] {
    display: none;
}

.detail-header {
    margin-bottom: 25px;
}

.detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 5px;
    padding-right: 80px;
}

.detail-cat {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.prop-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prop-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.prop-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.prop-value {
    font-size: 1.05rem;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

#noResults {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

#noResults i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}
