/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1f4788;
    --secondary-blue: #2874f0;
    --accent-orange: #ff9f1c;
    --accent-yellow: #ffb800;
    --text-dark: #212121;
    --text-light: #878787;
    --bg-light: #f0f0f0;
    --bg-lighter: #ffffff;
    --border-light: #e0e0e0;
    --success-green: #31a24c;
    --warning-red: #d32f2f;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    transition: color 0.3s ease;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: linear-gradient(90deg, #1f4788 0%, #2874f0 50%, #1f4788 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo:before {
    content: "📱";
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #ffb800;
    border-bottom-color: #ffb800;
}

.register-btn {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.register-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #ffb800;
}

.logout-btn {
    background-color: rgba(255, 152, 0, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: rgba(255, 152, 0, 0.4);
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 1rem 2rem;
    margin: 1rem 2rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

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

.alert-success {
    background-color: #e8f5e9;
    color: var(--success-green);
    border-left: 4px solid var(--success-green);
}

.alert-error {
    background-color: #ffebee;
    color: var(--warning-red);
    border-left: 4px solid var(--warning-red);
}

.alert-warning {
    background-color: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-alert:hover {
    opacity: 1;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 300px);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #2874f0 0%, #1f4788 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 116, 240, 0.3);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-small {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

.btn-add-to-cart {
    background: linear-gradient(135deg, #ff9f1c 0%, #ffb800 100%);
    color: white;
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-add-to-cart:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.3);
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, #1f4788 0%, #2874f0 50%, #2a5298 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 3rem;
    box-shadow: 0 8px 24px rgba(47, 71, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.hero:before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 184, 0, 0.1);
    border-radius: 50%;
}

.hero-content h1 {
    font-size: 3.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.hero-content .btn {
    margin: 0 0.8rem;
}

/* ==================== FEATURES ==================== */
.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.8rem;
    color: var(--text-dark);
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ==================== CTA SECTION ==================== */
.cta-section {
    background: linear-gradient(135deg, #ff9f1c 0%, #ffb800 50%, #ff9f1c 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 3rem 0;
    box-shadow: 0 8px 24px rgba(255, 159, 28, 0.2);
}

.cta-section h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.cta-section p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== AUTH FORMS ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-light);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--bg-light);
}

.form-group input:focus {
    outline: none;
    border-color: #2874f0;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(40, 116, 240, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.auth-footer a {
    color: #2874f0;
    font-weight: 600;
}

/* ==================== SHOP ==================== */
.shop-container {
    animation: fadeIn 0.4s ease;
}

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

.shop-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-light);
}

.shop-container h1 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 2.2rem;
    font-weight: 700;
}

.shop-subtitle {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* ==================== PRODUCTS GRID ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--border-light);
    transform: translateY(-4px);
}

.product-image-wrapper {
    position: relative;
    height: 220px;
    background: var(--bg-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge-hot {
    background-color: var(--warning-red);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-limited {
    background-color: var(--accent-orange);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==================== PRODUCT INFO ==================== */
.product-info {
    padding: 1.2rem;
}

.product-category-tag {
    display: inline-block;
    background: linear-gradient(135deg, #2874f0 0%, #1f4788 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.product-name {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
    min-height: 2.6em;
}

.product-description {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== RATING ==================== */
.product-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
}

.stars {
    color: var(--accent-yellow);
    font-size: 0.8rem;
}

.rating-value {
    color: var(--text-light);
    font-weight: 600;
}

/* ==================== PRICE SECTION ==================== */
.product-price-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
}

.discount {
    background-color: #e8f5e9;
    color: var(--success-green);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==================== STOCK INFO ==================== */
.stock-info {
    margin-bottom: 0.8rem;
}

.stock-badge {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
}

.stock-info.in-stock .stock-badge {
    background-color: #e8f5e9;
    color: var(--success-green);
}

.stock-info.in-stock .stock-badge.limited {
    background-color: #fff3e0;
    color: #f57c00;
}

.stock-info.out-stock .stock-badge.out {
    background-color: #ffebee;
    color: var(--warning-red);
}

/* ==================== QUANTITY SELECTOR ==================== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.quantity-selector label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.qty-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-select:focus {
    outline: none;
    border-color: #2874f0;
    box-shadow: 0 0 0 2px rgba(40, 116, 240, 0.1);
}

/* ==================== CART ==================== */
.cart-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-container h1 {
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.cart-table thead {
    background-color: var(--bg-light);
}

.cart-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-light);
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:hover {
    background-color: var(--bg-light);
}

.product-col {
    display: flex;
    gap: 1rem;
}

.item-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.item-details h4 {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.item-id {
    font-size: 0.85rem;
    color: var(--text-light);
}

.quantity-col {
    text-align: center;
}

.total-col {
    text-align: right;
    font-weight: 700;
    color: #2874f0;
}

.cart-summary {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.summary-item.total {
    border-top: 2px solid var(--border-light);
    padding-top: 1rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.empty-state p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* ==================== FOOTER ==================== */
.footer {
    background: linear-gradient(135deg, #1f4788 0%, #2874f0 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .navbar-container {
        padding: 0.8rem 1.5rem;
    }

    .nav-menu {
        gap: 1.5rem;
    }

    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .price {
        font-size: 1.2rem;
    }
}
