﻿/* Hardware Store - Main Stylesheet */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --accent-color: #f7931e;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --bg-light: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --star-color: #ffa41c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* Header */
.site-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 24px;
    color: white;
    margin: 0;
}

.logo a {
    color: white;
    text-decoration: none;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
}

    .search-bar input {
        flex: 1;
        padding: 10px 15px;
        border: none;
        border-radius: 4px 0 0 4px;
        font-size: 14px;
    }

    .search-bar button {
        padding: 10px 20px;
        background-color: var(--primary-color);
        border: none;
        border-radius: 0 4px 4px 0;
        color: white;
        cursor: pointer;
        font-size: 16px;
    }

        .search-bar button:hover {
            background-color: #e55a2b;
        }

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

    .main-nav a:hover {
        text-decoration: underline;
    }

.cart-link {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
}

/* Footer */
.site-footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

    .footer-section ul li {
        margin-bottom: 8px;
    }

.footer-section a {
    color: white;
    text-decoration: none;
}

    .footer-section a:hover {
        color: var(--accent-color);
    }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

    .btn-primary:hover {
        background-color: #e55a2b;
        text-decoration: none;
    }

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

    .btn-secondary:hover {
        background-color: #003d6b;
        text-decoration: none;
    }

.btn-block {
    display: block;
    width: 100%;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 60px;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 24px;
    margin-bottom: 30px;
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 30px 0;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

    .product-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        transform: translateY(-2px);
    }

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.product-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: var(--bg-light);
}

    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.quick-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .quick-view-overlay {
    opacity: 1;
}

.btn-quick-view {
    background-color: white;
    color: var(--secondary-color);
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.product-details {
    padding: 16px;
}

.product-brand {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 4px;
}

.product-title {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
}

    .product-title a {
        color: var(--text-color);
        text-decoration: none;
    }

        .product-title a:hover {
            color: var(--primary-color);
        }

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.stars {
    color: var(--star-color);
    font-size: 16px;
    letter-spacing: 2px;
}

.review-count {
    color: var(--text-light);
    font-size: 14px;
}

.product-price {
    margin-bottom: 8px;
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.original-price {
    font-size: 16px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 8px;
}

.product-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.4;
}

.btn-add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .btn-add-to-cart:hover {
        background-color: #e08419;
    }

/* Featured Products / Carousel */
.featured-products {
    margin: 60px 0;
}

    .featured-products h2 {
        text-align: center;
        margin-bottom: 40px;
        font-size: 32px;
    }

.text-center {
    text-align: center;
    margin-top: 30px;
}

/* Categories */
.categories-section {
    margin: 60px 0;
}

    .categories-section h2 {
        text-align: center;
        margin-bottom: 40px;
        font-size: 32px;
    }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.category-card {
    background-color: var(--bg-light);
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .category-card:hover {
        background-color: var(--secondary-color);
        color: white;
        transform: translateY(-4px);
    }

    .category-card h3 {
        margin-bottom: 10px;
    }

/* Filters */
.filters-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-light);
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .filter-group label {
        font-weight: 500;
    }

    .filter-group select {
        padding: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 14px;
    }

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
}

    .modal-close:hover {
        color: var(--text-color);
    }

.quick-view {
    text-align: center;
}

    .quick-view img {
        max-width: 100%;
        height: auto;
        margin-bottom: 20px;
    }

    .quick-view h2 {
        margin-bottom: 10px;
    }

    .quick-view .btn {
        margin: 10px 5px;
    }

/* Product Details Page */
.product-details-page {
    padding: 40px 0;
}

.product-details-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-gallery {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.main-image {
    width: 100%;
    height: 500px;
    background-color: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

    .main-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.thumbnail-images {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

    .thumbnail:hover,
    .thumbnail.active {
        border-color: var(--primary-color);
    }

.product-info h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.product-info .product-brand {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.product-info .product-rating {
    margin-bottom: 20px;
}

.product-info .product-price {
    margin-bottom: 20px;
}

.product-info .price {
    font-size: 32px;
}

.stock-status {
    margin-bottom: 20px;
    font-weight: 500;
}

.in-stock {
    color: var(--success-color);
}

.out-of-stock {
    color: var(--danger-color);
}

.product-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.quantity-selector {
    margin-bottom: 20px;
}

    .quantity-selector label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
    }

    .quantity-selector select {
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 16px;
    }

.product-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
}

    .product-actions .btn {
        flex: 1;
    }

.product-specs {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

    .product-specs h3 {
        margin-bottom: 20px;
    }

    .product-specs table {
        width: 100%;
        border-collapse: collapse;
    }

    .product-specs td {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

/* Cart Page */
.cart-page h1 {
    margin-bottom: 30px;
}

.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.cart-items {
    background-color: white;
}

.empty-cart {
    padding: 40px;
    text-align: center;
    background-color: var(--bg-light);
    border-radius: 8px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.cart-item-brand {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: 500;
}

.cart-item-quantity select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.cart-item-subtotal {
    font-size: 18px;
    font-weight: bold;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    text-decoration: underline;
}

.order-summary {
    background-color: var(--bg-light);
    padding: 24px;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

    .order-summary h2 {
        margin-bottom: 20px;
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

    .summary-row.total {
        font-size: 20px;
        font-weight: bold;
        border-bottom: none;
        margin-top: 10px;
    }

.promo-code {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

    .promo-code input {
        flex: 1;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--secondary-color);
}

/* Checkout Page */
.checkout-page h1 {
    margin-bottom: 30px;
}

.checkout-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.checkout-section {
    background-color: white;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

    .checkout-section h2 {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid var(--border-color);
    }

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 10px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 16px;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--primary-color);
        }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.radio-group label {
    display: block;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .radio-group label:hover {
        background-color: var(--bg-light);
    }

.radio-group input[type="radio"] {
    margin-right: 10px;
}

.checkout-items {
    margin-bottom: 20px;
}

.checkout-item {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

    .checkout-item img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 4px;
    }

.checkout-item-info {
    flex: 1;
}

    .checkout-item-info p {
        margin: 0;
        font-size: 14px;
    }

.checkout-item-price {
    font-weight: bold;
}

/* Thank You Page */
.thankyou-page {
    text-align: center;
    padding: 60px 0;
}

.thankyou-content {
    max-width: 700px;
    margin: 0 auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 30px;
}

.thankyou-content h1 {
    margin-bottom: 20px;
}

.order-number {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.order-confirmation {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.order-summary-box {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.order-items {
    margin-bottom: 20px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.order-totals {
    margin-top: 20px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

    .order-total-row.total {
        font-size: 20px;
        font-weight: bold;
        border-top: 2px solid var(--border-color);
        padding-top: 15px;
        margin-top: 10px;
    }

.shipping-address {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.next-steps {
    text-align: left;
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

    .next-steps ul {
        margin-top: 15px;
        padding-left: 20px;
    }

    .next-steps li {
        margin-bottom: 10px;
    }

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* About & Contact Pages */
.about-page,
.contact-page {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h2 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.about-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.contact-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.contact-form h2,
.contact-info h2 {
    margin-bottom: 20px;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
}

    .form-message.success {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .form-message.error {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

.contact-info h3 {
    margin-top: 30px;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-details-container,
    .cart-container,
    .checkout-container,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .order-summary {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }

    .search-bar {
        max-width: 100%;
        order: 3;
        width: 100%;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }

    .cart-item-quantity,
    .cart-item-subtotal,
    .cart-item-remove {
        grid-column: 2;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
