/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #faf7f2;
    color: #5c4b3a;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.top-bar {
    background: #8b6b4d;
    color: #fff;
    font-size: 13px;
    padding: 8px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.contact-info span {
    margin-right: 20px;
}

.contact-info i {
    margin-right: 5px;
    color: #f9d56e;
}

.user-links a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
}

.user-links a:hover {
    color: #f9d56e;
}

/* Header */
header {
    background: #fff8f0;
    box-shadow: 0 2px 15px rgba(139, 107, 77, 0.1);
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Circular Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c44f4f;
    box-shadow: 0 2px 8px rgba(196, 79, 79, 0.2);
    padding: 3px;
}

.logo:hover {
    transform: scale(1.05);
    border-color: #a13e3e;
}

.logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e8d9cc;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.search-bar input:focus {
    outline: none;
    border-color: #c44f4f;
}

.search-bar button {
    padding: 12px 20px;
    background: #c44f4f;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}

.search-bar button:hover {
    background: #a13e3e;
}

/* Header Icons */
.header-icons {
    flex: 0 0 auto;
    display: flex;
    gap: 20px;
}

.header-icons > div {
    position: relative;
    cursor: pointer;
}

.header-icons i {
    font-size: 24px;
    color: #8b6b4d;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #c44f4f;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* Navigation */
nav {
    background: #fff8f0;
    border-bottom: 2px solid #f0e4d5;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu {
    display: flex;
    list-style: none;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 5px;
}

.nav-menu a {
    color: #8b6b4d;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
}

.nav-menu a:hover {
    color: #c44f4f;
    background: #f0e4d5;
}

.nav-menu li.active a {
    color: #c44f4f;
    font-weight: 600;
}

/* Flash Sale Banner */
.flash-sale {
    background: linear-gradient(135deg, #c44f4f 0%, #e8a87c 100%);
    color: #fff;
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
}

.sale-content h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.timer {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    background: rgba(255,255,255,0.2);
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    font-family: monospace;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(139, 107, 77, 0.1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 107, 77, 0.2);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #c44f4f;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1;
}

.product-image {
    height: 250px;
    overflow: hidden;
    cursor: pointer;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #5c4b3a;
}

.product-category {
    color: #8b6b4d;
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.current-price {
    font-size: 22px;
    font-weight: 700;
    color: #c44f4f;
}

.original-price {
    color: #a5a5a5;
    text-decoration: line-through;
    font-size: 14px;
}

/* Color Options */
.color-options {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.color-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.color-circle.selected {
    border-color: #c44f4f;
}

/* Product Actions */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.add-to-cart, .shop-now {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.add-to-cart {
    background: #c44f4f;
    color: #fff;
    border: none;
}

.add-to-cart:hover {
    background: #a13e3e;
}

.shop-now {
    background: transparent;
    color: #c44f4f;
    border: 2px solid #c44f4f;
}

.shop-now:hover {
    background: #c44f4f;
    color: white;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff8f0;
    box-shadow: -2px 0 20px rgba(139, 107, 77, 0.2);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #f0e4d5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #8b6b4d;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0e4d5;
}

.cart-item img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    font-size: 15px;
    margin-bottom: 5px;
    color: #5c4b3a;
}

.cart-item-price {
    color: #c44f4f;
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    background: #f0e4d5;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-btn:hover {
    background: #c44f4f;
    color: white;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.cart-item-remove {
    color: #8b6b4d;
    cursor: pointer;
    padding: 5px;
}

.cart-item-remove:hover {
    color: #c44f4f;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #f0e4d5;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #5c4b3a;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #c44f4f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.checkout-btn:hover {
    background: #a13e3e;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 75, 58, 0.5);
    z-index: 999;
    display: none;
}

.overlay.active {
    display: block;
}

/* ===== ENHANCED CHECKOUT MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 75, 58, 0.5);
    z-index: 2000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff8f0;
    border-radius: 15px;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 28px;
    cursor: pointer;
    color: #8b6b4d;
    z-index: 1;
}

.close:hover {
    color: #c44f4f;
}

/* Checkout Layout */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.checkout-section h2 {
    color: #5c4b3a;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c44f4f;
}

.checkout-section h2 i {
    color: #c44f4f;
    margin-right: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #5c4b3a;
}

.form-group label i {
    color: #c44f4f;
    width: 20px;
    margin-right: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e8d9cc;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #c44f4f;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Order Summary */
.order-summary {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.order-items-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #e8d9cc;
}

.order-item-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.order-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.order-item-name {
    font-weight: 600;
    color: #5c4b3a;
}

.order-item-meta {
    font-size: 12px;
    color: #8b6b4d;
}

.order-item-price {
    font-weight: 600;
    color: #c44f4f;
}

.price-breakdown {
    background: #faf7f2;
    padding: 15px;
    border-radius: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #5c4b3a;
}

.price-row.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px dashed #e8d9cc;
    font-size: 20px;
    font-weight: 700;
    color: #c44f4f;
}

.free-badge {
    color: #28a745;
    font-weight: 600;
}

/* Info Box */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-box i {
    color: #2196f3;
    font-size: 24px;
}

.info-box-content h4 {
    color: #0b5e9e;
    margin-bottom: 5px;
}

.info-box-content p {
    color: #5c4b3a;
    font-size: 13px;
}

/* Checkout Actions */
.checkout-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.checkout-actions .btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
}

.btn-secondary {
    background: #8b6b4d;
}

.btn-secondary:hover {
    background: #6b4f37;
}

/* Footer */
footer {
    background: #8b6b4d;
    color: #fff;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #f9d56e;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
}

.footer-section ul li a:hover {
    color: #f9d56e;
}

.social-links a {
    color: #fff;
    margin-right: 15px;
    font-size: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #a98e75;
    color: #f0e4d5;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff8f0;
    color: #5c4b3a;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(139, 107, 77, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #c44f4f;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #8b6b4d;
}

.loading:after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 2px solid #f0e4d5;
    border-top-color: #c44f4f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .cart-sidebar {
        width: 100%;
    }
    
    .timer {
        font-size: 32px;
        padding: 10px 20px;
    }
}