:root {
    /* Dark Mode (Default) */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --accent: #00d4ff; 
    --buy-btn: #ffa41c; 
    --buy-btn-hover: #fa8900;
    --border: #333;
    --nav-bg: #1a1a1a;
    --table-header: #2a2a2a;
    --btn-sec-bg: #383838;
    --btn-sec-text: #ffffff;
    --deal-red: #cc0c39;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-color: #eaeded;
    --card-bg: #ffffff;
    --text-main: #0f1111;
    --text-muted: #565959;
    --accent: #007185; 
    --buy-btn: #ffd814; 
    --buy-btn-hover: #f7ca00;
    --border: #d5d9d9;
    --nav-bg: #131921; 
    --table-header: #f0f2f2;
    --btn-sec-bg: #ffffff;
    --btn-sec-text: #0f1111;
    --deal-red: #cc0c39;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* Navbar */
.navbar {
    background-color: var(--nav-bg);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.highlight {
    color: #ffa41c;
}

.search-bar {
    display: flex;
    flex-grow: 1;
    max-width: 600px;
    margin: 0 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border-radius: 4px 0 0 4px;
    border: none;
    outline: none;
}

.search-bar button {
    padding: 10px 20px;
    background-color: #febd69;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: bold;
}

.nav-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-btn {
    color: white;
    cursor: pointer;
    font-size: 20px;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 24px;
    color: white;
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ffa41c;
    color: black;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Product Page Layout */
.product-page {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 20px;
}

.product-gallery {
    flex: 1;
    min-width: 300px;
}

.main-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}

.badges {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.best-seller { background-color: #e67a00; color: white; }
.choice { background-color: #232f3e; border: 1px solid white; color: white; }

.product-details {
    flex: 1.5;
    min-width: 300px;
}

.product-title {
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.rating {
    color: #ffa41c;
    margin-bottom: 5px;
    font-size: 14px;
}

.rating-text {
    color: var(--accent);
    margin-left: 10px;
}

/* Deal Badge */
.deal-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.deal-tag {
    background-color: var(--deal-red);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 12px;
}

.deal-timer {
    color: var(--deal-red);
    font-weight: bold;
}

.price-section {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    margin-bottom: 20px;
}

.price {
    font-size: 24px;
    color: #b12704;
    font-weight: bold;
    margin: 0 10px;
}

body.light-mode .price {
    color: #B12704;
}

.stock-status {
    color: #007600;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.description {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.features-list {
    margin-top: 10px;
    list-style: none;
}

.features-list li {
    margin-bottom: 8px;
}

.features-list i {
    color: var(--accent);
    margin-right: 8px;
}

/* Buttons */
.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: var(--buy-btn);
    color: black;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
    transition: transform 0.2s;
}

.btn-primary:hover {
    background-color: var(--buy-btn-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background-color: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border: 1px solid #777;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    flex: 1;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background-color: #ddd;
    color: black;
}

/* Sections */
.section-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.section-container h2 {
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-main);
}

.card .tech-stack {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card .price-tag {
    font-weight: bold;
    color: #b12704;
    display: block;
    margin-top: 10px;
    margin-bottom: 15px;
}

.add-btn-small {
    background-color: var(--buy-btn);
    color: #000;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th, .specs-table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
    color: var(--text-main);
}

.specs-table th {
    background-color: var(--table-header);
    color: var(--text-muted);
    width: 30%;
}

/* Comparison Table (NEW) */
.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: var(--text-main);
}

.comparison-table th, .comparison-table td {
    border: 1px solid var(--border);
    padding: 15px;
}

.comparison-table th {
    background-color: var(--table-header);
    font-weight: normal;
    color: var(--text-muted);
}

.highlight-col {
    background-color: rgba(0, 212, 255, 0.05); /* Very slight blue tint */
    border-left: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

body.light-mode .highlight-col {
    background-color: #f7fafa;
}

/* Q&A Section (NEW) */
.qa-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.qa-item .question {
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 5px;
}

.qa-item .question i {
    color: var(--accent);
    margin-right: 5px;
}

.qa-item .answer {
    color: var(--text-muted);
    margin-left: 20px;
}

/* Review Card */
.review-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    color: var(--text-main);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-icon {
    width: 30px;
    height: 30px;
    background-color: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--accent);
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    color: var(--text-main);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.full-width {
    width: 100%;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .product-page {
        flex-direction: column;
    }
    .specs-table th, .specs-table td {
        display: block;
        width: 100%;
    }
}