/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.top-bar {
    background-color: #f8f8f8;
    padding: 8px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #eee;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info a {
    margin-right: 15px;
    color: #666;
}

.contact-info a i {
    margin-right: 5px;
    color: #999;
}

.slogan {
    color: #666;
    font-style: italic;
}

.user-actions a {
    margin-left: 10px;
    color: #666;
    font-weight: bold;
}

.user-actions .divider {
    color: #ccc;
    margin: 0 5px;
}

.user-actions .cart {
    color: #e74c3c;
}

.main-header {
    padding: 20px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo h1 {
    color: #8B4513;
    font-size: 2.5rem;
    letter-spacing: 2px;
}

.logo p {
    color: #999;
    font-size: 0.8rem;
}

.search-bar {
    flex-grow: 1;
    max-width: 500px;
    margin: 0 20px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search-bar button {
    padding: 10px 15px;
    background-color: #8B4513;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.main-nav {
    background-color: #8B4513;
    padding: 10px 0;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav li {
    margin: 0 10px;
}

.main-nav a {
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Main Content Styles */
main {
    padding: 30px 0;
}

section {
    margin-bottom: 40px;
}

section h2 {
    text-align: center;
    color: #8B4513;
    margin-bottom: 30px;
    position: relative;
    font-size: 1.8rem;
}

section h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: #8B4513;
    margin: 10px auto;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #333;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-category {
    color: #999;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.product-sold {
    color: #666;
    font-size: 0.8rem;
}

.product-price {
    display: flex;
    align-items: center;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-right: 8px;
}

.current-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.add-to-cart {
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    flex-grow: 1;
    margin-right: 10px;
}

.add-to-cart:hover {
    background-color: #6d3609;
}

.view-details {
    background-color: transparent;
    color: #8B4513;
    border: 1px solid #8B4513;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.view-details:hover {
    background-color: #8B4513;
    color: white;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: #fff;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
}

.footer-section h3::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background-color: #8B4513;
    margin-top: 10px;
}

.footer-section p {
    color: #bbb;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.contact span {
    display: block;
    margin-bottom: 10px;
    color: #bbb;
    font-size: 0.9rem;
}

.contact i {
    margin-right: 10px;
    color: #8B4513;
}

.socials a {
    display: inline-block;
    margin-right: 15px;
    color: #bbb;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.socials a:hover {
    color: #8B4513;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bbb;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #8B4513;
    padding-left: 5px;
}

.payment-methods {
    margin-bottom: 15px;
}

.payment-methods i {
    font-size: 2rem;
    margin-right: 15px;
    color: #bbb;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.footer-bottom p {
    color: #bbb;
    font-size: 0.8rem;
}

/* Product Detail Page */
.product-detail {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.product-gallery {
    position: relative;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.thumbnail:hover, .thumbnail.active {
    border-color: #8B4513;
}

.product-info-detail h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 15px;
}

.product-category-detail {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.product-meta-detail {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.product-sold-detail {
    color: #666;
    font-size: 0.9rem;
    margin-right: 20px;
}

.product-price-detail {
    display: flex;
    align-items: center;
}

.original-price-detail {
    color: #999;
    text-decoration: line-through;
    font-size: 1rem;
    margin-right: 10px;
}

.current-price-detail {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.5rem;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 10px;
}

.product-description p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 15px;
}

.product-actions-detail {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.add-to-cart-detail {
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.add-to-cart-detail:hover {
    background-color: #6d3609;
}

.buy-now {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.buy-now:hover {
    background-color: #c0392b;
}

/* Checkout Page */
.checkout-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 30px;
    position: relative;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.checkout-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #4CAF50;
    outline: none;
}

.payment-options {
    margin-bottom: 30px;
}

.payment-option {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}

.payment-option:not(:first-child) {
    margin-top: 15px;
    border-radius: 4px;
}

.payment-option:hover,
.payment-option.active {
    border-color: #8B4513;
    background-color: #f9f5f2;
}

.payment-option input {
    margin-right: 15px;
}

.payment-option-info {
    flex-grow: 1;
}

.payment-option-title {
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
}

.payment-option-description {
    color: #666;
    font-size: 0.9rem;
}

.payment-option-icon {
    font-size: 2rem;
    color: #8B4513;
}

.payment-details {
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.payment-details a {
    color: #8B4513;
    font-weight: bold;
}

.payment-details a:hover {
    text-decoration: underline;
}

.order-summary {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
}

.order-summary h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.order-items {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.order-item-info {
    flex-grow: 1;
}

.order-item-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    max-width: 600px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-item-price {
    color: #e74c3c;
    font-weight: bold;
}

.order-totals {
    margin-bottom: 20px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.order-total-row.final {
    font-weight: bold;
    color: #333;
    font-size: 1.2rem;
    border-bottom: none;
}

.checkout-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    width: 100%;
    transition: background-color 0.3s;
}

.checkout-button:hover {
    background-color: #c0392b;
}

/* Cart Page Styles */
.cart-page {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

/* Table Layout Styles */
.cart-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cart-table thead {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.cart-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    color: #555;
}

.cart-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.cart-table tbody tr:hover {
    background-color: #f9f9f9;
}

.cart-table td {
    padding: 15px;
    vertical-align: middle;
}

.item-col {
    width: 40%;
}

.item-col .product-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    max-height: 3em;
}

.price-col, .total-col {
    width: 15%;
    text-align: center;
    font-weight: 600;
}

.quantity-col {
    width: 20%;
    text-align: center;
}

.action-col {
    width: 10%;
    text-align: center;
}

.cart-item-details {
    display: flex;
    align-items: center;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #eee;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.7rem;
    margin-bottom: 5px;
    color: #333;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
    height: 1.7rem;
    word-break: break-word;
}

.cart-item-category {
    color: #888;
    font-size: 0.8rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 120px;
}

.quantity-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
}

.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    margin: 0 5px;
}

.remove-item {
    background-color: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.remove-item:hover {
    color: #c0392b;
}

.empty-cart {
    text-align: center;
    padding: 30px 0;
    color: #666;
    font-size: 1.1rem;
}

.empty-cart a {
    color: #8B4513;
    font-weight: bold;
    text-decoration: underline;
}

.cart-summary {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cart-summary h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.summary-label {
    color: #555;
}

.checkout-btn {
    background-color: #8B4513;
    color: white;
    border: none;
    padding: 12px 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-bottom: 10px;
    transition: background-color 0.3s;
    font-size: 1.1rem;
}

.checkout-btn:hover {
    background-color: #6d3609;
}

.continue-shopping {
    display: block;
    text-align: center;
    color: #8B4513;
    font-weight: bold;
    padding: 10px 0;
    transition: color 0.2s;
}

.continue-shopping:hover {
    color: #6d3609;
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .top-bar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-info, .user-actions {
        margin-bottom: 10px;
    }

    .main-header .container {
        flex-direction: column;
    }

    .logo {
        margin-bottom: 20px;
    }

    .search-bar {
        max-width: 100%;
        margin: 0 0 20px 0;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
    }

    .checkout-container {
        grid-template-columns: 3fr 2fr;
        gap: 25px;
    }

    .order-summary {
        position: static;
    }

    .cart-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav li {
        margin: 5px 0;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .product-actions {
        flex-direction: column;
        gap: 10px;
    }

    .add-to-cart {
        margin-right: 0;
    }

    .product-actions-detail {
        flex-direction: column;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .checkout-form-container {
        width: 100%;
    }
    
    .order-summary {
        width: 100%;
    }
}