:root {
    --bg-dark: #0a0a0a;
    --bg-card: rgba(30, 30, 30, 0.75);
    --bg-card-hover: rgba(40, 40, 40, 0.85);
    --text-primary: #f5f5f5;
    --text-secondary: #aaaaaa;
    --accent-gold: #D4AF37;
    --accent-gold-dark: #A68729;
    --accent-copper: #B87333;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
    
    --border-gold-light: rgba(212, 175, 55, 0.3);
    --border-gold-strong: rgba(212, 175, 55, 0.8);
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    /* Soft background gradient overlaying the very dark base */
    background: radial-gradient(circle at top right, #1f1d19 0%, #0a0a0a 100%);
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Glassmorphism Background Overlay */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    /* Optional: Replace with a subtle smoke or wood texture if available */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="%230a0a0a" width="100" height="100"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="rgba(212,175,55,0.01)" stroke-width="1"/></svg>') repeat;
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Typography Details */
header {
    text-align: center;
    margin-bottom: 40px;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-copper));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.brand-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 5px;
    font-weight: 300;
}

/* Search Section */
.search-section {
    width: 100%;
    max-width: 600px;
    text-align: center;
    transition: opacity 0.4s ease;
}

.instruction {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.search-box {
    position: relative;
    width: 100%;
    display: flex;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-radius: 50px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-gold-light);
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 25px rgba(212, 175, 55, 0.2);
}

#barcodeInput {
    flex: 1;
    background: rgba(10, 10, 10, 0.4);
    border: none;
    padding: 18px 25px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-body);
}

#barcodeInput:focus {
    outline: none;
}

#barcodeInput::placeholder {
    color: #666;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--accent-gold);
    padding: 0 25px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.3s ease, background 0.3s ease;
}

.search-box button:hover {
    color: var(--text-primary);
    background: rgba(212, 175, 55, 0.2);
}

/* Error and Loading */
.error-message {
    color: #ff5e5e;
    margin-top: 15px;
    font-size: 0.95rem;
    opacity: 1;
    transition: opacity 0.3s;
}

.loading {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Product Card */
.product-card {
    width: 100%;
    max-width: 900px;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--accent-gold);
    font-size: 1rem;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 20px;
    padding: 0;
    transition: color 0.3s;
    font-family: var(--font-body);
}

.btn-back:hover {
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.card-inner {
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid var(--border-gold-light);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-image-wrapper {
    position: relative;
    flex-shrink: 0;
    background: #ffffff; /* Typically product images have white backgrounds */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    border-bottom: 1px solid var(--border-gold-light);
    min-height: 250px;
}

.card-image-wrapper img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    mix-blend-mode: multiply; /* Allows white bg images to blend a bit nicely, or just act normally */
}

/* Give image dark bg if needed? Let's leave it pristine */
.card-image-wrapper {
    background: radial-gradient(circle, #f5f5f5 0%, #cfcfcf 100%);
}

.type-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-gold);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--accent-gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.card-details {
    padding: 40px;
    flex-grow: 1;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    color: var(--accent-gold);
}

.product-manufacturer {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0 0 30px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.feature-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-gold);
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-label {
    display: block;
    font-size: 0.85rem;
    color: var(--accent-copper);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: bold;
}

.feature-val {
    display: block;
    font-size: 1.1rem;
    color: var(--text-primary);
}

footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
}

/* Media Queries for Tablets and Phones */
@media (min-width: 768px) {
    .card-inner {
        flex-direction: row;
    }
    
    .card-image-wrapper {
        width: 40%;
        border-bottom: none;
        border-right: 1px solid var(--border-gold-light);
    }
    
    .card-details {
        width: 60%;
        padding: 50px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 2.2rem;
    }
    
    .card-details {
        padding: 25px;
    }
    
    .product-title {
        font-size: 1.8rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
}
