/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

a:hover {
    color: #0056b3;
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn {
    background: #007bff;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.secondary-btn {
    background: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background: #545b62;
}

/* Header */
.shop-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.shop-logo h1 {
    color: #007bff;
    margin: 0;
}

.shop-tagline {
    font-size: 0.875rem;
    color: #6c757d;
}

.shop-nav {
    display: flex;
    gap: 2rem;
}

.category-filter {
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-filter:hover,
.category-filter.active {
    background: #007bff;
    color: white;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
    display: flex;
}

#search-input {
    padding: 10px 40px 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    width: 250px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    outline: none;
    border-color: #007bff;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.cart-btn:hover {
    background: #f8f9fa;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.shop-main {
    padding: 2rem 0;
}

.hero-section {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

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

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view-btn {
    background: white;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 1rem;
}

.product-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.option-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #495057;
}

.product-options select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.product-options select:focus {
    outline: none;
    border-color: #007bff;
}

.product-options select.error {
    border-color: #dc3545;
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #218838;
}

.add-to-cart-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.cart-item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

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

.cart-item-name {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.cart-item-options {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #f8f9fa;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.cart-summary {
    margin-bottom: 1rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cart-total-row {
    font-weight: 600;
    font-size: 1.1rem;
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
}

.cart-actions {
    display: flex;
    gap: 1rem;
}

.cart-actions button {
    flex: 1;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .shop-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    #search-input {
        width: 200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-options {
        gap: 0.75rem;
    }
    
    .cart-actions {
        flex-direction: column;
    }
}

/* Product Page Specific Styles */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

.product-image-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 12px;
}

.product-details {
    padding: 2rem 0;
}

.product-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-description {
    margin-bottom: 1.5rem;
    color: #6c757d;
}

.product-price {
    font-size: 2rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 1rem;
}

.color-swatches {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-swatch:hover,
.color-swatch.active {
    border-color: #007bff;
    transform: scale(1.1);
}

.size-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.size-button {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-button:hover,
.size-button.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
}

.product-features {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.feature-icon {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-image-main img {
        height: 300px;
    }
    
    .product-title {
        font-size: 1.5rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
}
