:root {
    --primary: #c91c33; /* Red used for the buttons and active tabs */
    --primary-hover: #a31528;
    --text-main: #333333;
    --text-muted: #999999;
    --bg-light: #fdfdfd;
    --border-color: #eaeaea;
    --success: #2db542;
    --star-color: #c91c33;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

/* --- Header --- */
.header {
    background: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Slight shadow just in case */
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-icons {
    display: flex;
    gap: 10px;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #666;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-circle:hover {
    background-color: #e2e2e2;
}

.country-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.user-welcome {
    max-width: 1200px;
    margin: 1rem auto 0;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sun-icon {
    font-size: 2rem;
}

.greeting {
    font-size: 1rem;
    font-weight: 500;
}

.login-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
}

/* --- Main Content --- */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Categories */
.categories {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    /* Hide scrollbar for clean look */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.categories::-webkit-scrollbar {
    display: none;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.category-btn.active {
    border-color: var(--primary);
    background-color: #fce8eb;
    color: var(--primary);
}

.cat-logo {
    font-family: 'Brush Script MT', cursive;
    color: #fff;
    background: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 1.1rem;
}

.cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: #333;
}
.cat-icon.spell { background: linear-gradient(135deg, #1a1a1a, #4a4128); border: 1px solid #d4af37; }
.cat-icon.extreme { background: linear-gradient(135deg, #a8e0ff, #ffb347); }
.cat-icon.everk { background: #fccc24; }

/* Search Section */
.search-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-bar {
    flex-grow: 1;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0 20px;
    background: #fff;
}

.search-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-bar input {
    width: 100%;
    border: none;
    padding: 15px 10px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.filter-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.filter-btn:hover { background: var(--primary-hover); }

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 10;
}

.fav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qty-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-main);
}
.qty-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 1rem;
    margin-top: 1rem; /* Space for absolute floating buttons */
}

.product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    line-height: 1.3;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.price-rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    margin-bottom: 1rem;
}

.price-container {
    display: flex;
    flex-direction: column;
}

/* Discount styles */
.old-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 0.1rem;
}

.new-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.discount-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 6px;
    vertical-align: middle;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
}
.rating i {
    color: var(--star-color);
}

.buy-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.buy-btn:hover { background: var(--primary-hover); }

/* --- Footer --- */
.footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.social-icons {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
    color: var(--primary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
}
.footer-links a:hover {
    text-decoration: underline;
}

.footer-company-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .footer-links {
        align-items: flex-start;
    }
}

/* Floating Actions */
.floating-cart {
    position: fixed;
    top: 5rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(201, 28, 51, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
}
.floating-cart:hover { transform: scale(1.05); }

.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(201, 28, 51, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
}
.scroll-top:hover { transform: scale(1.05); }

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--primary);
}

.checkout-product-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.checkout-product-summary img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
}

.checkout-summary-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.checkout-summary-info .price {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.form-group input.invalid {
    border-color: #ff3860;
}

.error-msg {
    color: #ff3860;
    font-size: 0.75rem;
    margin-top: 4px;
    display: none;
}

.submit-checkout-btn {
    width: 100%;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1rem;
}

.submit-checkout-btn:hover {
    background: #25a039;
}
