:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --accent: #007bff;
    --accent-hover: #0056b3;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 0;
}

header {
    background-color: var(--card-bg);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
}

.logo {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.container { max-width: 1000px; margin: 2rem auto; padding: 0 1rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    display: block;
}

.card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,123,255,0.2); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-info { padding: 1rem; }
.price { color: var(--accent); font-weight: bold; font-size: 1.2rem; }

/* Nupud ja Vormid */
button {
    background: var(--accent); color: white;
    border: none; padding: 0.8rem 1.5rem;
    border-radius: 4px; cursor: pointer; font-weight: bold;
}
button:hover { background: var(--accent-hover); }

input, textarea {
    width: 100%; padding: 0.8rem; margin-bottom: 1rem;
    background: #2a2a2a; border: 1px solid #444; color: white;
    border-radius: 4px; box-sizing: border-box;
}

.product-detail-img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; }
.admin-form { background: var(--card-bg); padding: 2rem; border-radius: 8px; }
/* Lisad style.css lõppu */
.badge {
    display: inline-block; padding: 0.3rem 0.6rem;
    border-radius: 4px; font-size: 0.85rem; font-weight: bold;
    margin-right: 10px; margin-bottom: 10px;
}
.badge-new { background: #28a745; color: white; }
.badge-used { background: #ffc107; color: black; }
.badge-warranty { background: #17a2b8; color: white; }

.cart-link { color: var(--accent); text-decoration: none; font-weight: bold; }
.cart-link:hover { color: var(--accent-hover); }

/* Ostukorvi tabeli disain */
.cart-item { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid #333; }
.cart-total { font-size: 1.5rem; font-weight: bold; text-align: right; margin-top: 1rem; color: var(--accent); }
/* Pildigalerii / Carousel */
.carousel {
    position: relative; width: 100%; height: 400px;
    background: #000; border-radius: 8px; margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.carousel img { max-width: 100%; max-height: 100%; display: none; object-fit: contain; }
.carousel img.active { display: block; }

.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.6); color: white; border: none;
    padding: 1rem; cursor: pointer; font-size: 1.5rem; z-index: 10;
}
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn:hover { background: var(--accent); }

/* Koguse sisestamine */
.qty-container { display: flex; align-items: center; margin-top: 1rem; margin-bottom: 1rem; }
.qty-input {
    width: 70px; padding: 0.8rem; text-align: center; font-size: 1.1rem;
    background: #2a2a2a; border: 1px solid #444; color: white; border-radius: 4px; margin-right: 15px;
}
/* iOS Stiilis Teavitus (Alert) */
.ios-alert {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 59, 48, 0.95); /* iOS Punane */
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-size: 1rem;
    font-weight: 600;
    z-index: 9999;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Põrkav animatsioon */
    backdrop-filter: blur(10px); /* Hägus efekt taustal */
    text-align: center;
    min-width: 250px;
}

.ios-alert.show {
    top: 40px; /* Kui kaugele ülevalt alla libiseb */
}

.ios-alert.success {
    background: rgba(52, 199, 89, 0.95); /* iOS Roheline */
}
/* --- MOBIILI OPTIMISEERIMINE --- */

/* Hoiab ära iOS (iPhone) automaatse suumimise vormidesse klikkimisel */
input, textarea, select {
    font-size: 16px !important; 
}

/* Tabeli kerimine mobiilis (Admin paneelile) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Sujuv kerimine iOS-is */
}

/* Reeglid väikestele ekraanidele (telefonidele) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 1rem;
    }
    
    .carousel {
        height: 250px; /* Mobiilis väiksem pildikast */
    }
    
    h1, h2 {
        font-size: 1.5rem;
    }
    
    .product-detail-img {
        max-height: 250px;
    }
    
    .qty-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .qty-input {
        width: 100px;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    /* Admin paneeli pildi ja hinna lahtrid mobiilis üksteise alla */
    .modal-content div[style*="display: flex"] {
        flex-direction: column;
    }
}
/* Variantide (Options) UI stiilid */
/* Variantide (Options) UI stiilid - TUME TEEMA */
.option-group {
    margin-bottom: 1.5rem;
}

.option-group-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.option-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option-btn {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 6px; /* Sobib ilusti teiste kastidega */
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 55px;
    text-align: center;
}

.option-btn:hover {
    border-color: #888;
    background-color: #333;
}

.option-btn.selected {
    border: 2px solid var(--accent); /* Sinu ilus sinine värv */
    background-color: rgba(0, 123, 255, 0.1); /* Õrn sinine kuma taustal */
    color: var(--accent);
    font-weight: bold;
    padding: 9px 17px; /* 1px vähem, et paksem äär ei hüpitaks nuppu */
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.15);
}

.option-price-mod {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
    font-weight: normal;
}