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

html {
    scroll-behavior: smooth;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background-color: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.btn-primary:hover {
    background-color: #34495e;
    border-color: #34495e;
}

.btn-secondary {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.btn-secondary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-outline {
    background-color: transparent;
    color: #2c3e50;
    border-color: #2c3e50;
}

.btn-outline:hover {
    background-color: #2c3e50;
    color: white;
}

.btn-full {
    width: 100%;
}

/* Header Styles */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background-color: #2c3e50;
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

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

.contact-info span {
    margin-right: 1rem;
}

.contact-info i {
    margin-right: 0.25rem;
}

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

.header-actions a {
    color: white;
    transition: color 0.3s ease;
}

.header-actions a:hover {
    color: #3498db;
}

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

.logo h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.logo p {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-form {
    display: flex;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-form button {
    padding: 0.75rem 1rem;
    background-color: #3498db;
    color: white;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #2980b9;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ecf0f1;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestion {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-suggestion:hover {
    background-color: #f8f9fa;
}

/* Navigation */
.main-nav {
    background-color: #34495e;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    transition: background-color 0.3s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    background-color: #2c3e50;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    transition: background-color 0.3s ease;
}

.dropdown-menu li a:hover {
    background-color: #f8f9fa;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    padding: 1rem;
    gap: 3px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    min-height: 600px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 4rem 0;
}

.hero-content {
    flex: 1;
    padding: 0 2rem;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    padding: 0 2rem;
}

.hero-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Featured Products */
.featured-products {
    padding: 4rem 0;
    background-color: #f8f9fa;
}

.featured-products h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 3rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

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

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

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

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

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

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-add-cart {
    flex: 1;
    padding: 0.75rem;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-add-cart:hover {
    background-color: #34495e;
}

/* Categories */
.categories {
    padding: 4rem 0;
}

.categories h2 {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.category-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem;
    text-align: center;
}

.category-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.category-content p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Newsletter */
.newsletter {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    outline: none;
}

/* Footer */
.footer {
    background-color: #34495e;
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
    color: #3498db;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.social-links a:hover {
    background-color: #2980b9;
}

.footer-bottom {
    border-top: 1px solid #7f8c8d;
    padding-top: 1rem;
    text-align: center;
    color: #bdc3c7;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

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

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

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

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

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
}

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

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

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #3498db;
    font-weight: 600;
}

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

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.cart-total {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

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

/* Modal */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-body {
    padding: 1.5rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: color 0.3s ease;
}

.auth-tab.active {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: #3498db;
}

/* Responsive Design */

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
}

/* Desktop to Tablet - 992px to 1199px */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

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

/* Tablet to Large Phone - 768px to 991px */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
        padding: 0 1rem;
    }

    .hero {
        min-height: 500px;
        padding: 3rem 0;
    }

    .hero-content h2 {
        font-size: 2.25rem;
    }

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

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }

    .cart-sidebar {
        width: 350px;
    }
}

/* Tablet - 768px to 767px */
@media (max-width: 768px) {
    .header-top .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .contact-info {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .contact-info span {
        margin-right: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem;
    }

    .header-actions a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem;
    }

    .header-main {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #34495e;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-menu > li > a {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        min-height: 44px;
        min-width: 44px;
        justify-content: center;
        align-items: center;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: #2c3e50;
    }

    .dropdown-menu li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 2rem 1rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

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

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
        padding: 0 1rem 2rem;
    }

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

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }

    .newsletter-form input {
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
        max-width: 400px;
    }

    .modal {
        width: 95%;
        max-width: 450px;
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

/* Large Phone - 600px to 767px */
@media (max-width: 600px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .logo p {
        font-size: 0.75rem;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

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

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

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

    .product-image {
        height: 200px;
    }

    .product-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 1.125rem;
    }

    .product-price {
        font-size: 1.25rem;
    }

    .category-card {
        height: 350px;
    }

    .category-content {
        padding: 1.5rem;
    }

    .category-content h3 {
        font-size: 1.375rem;
    }

    .featured-products h2,
    .categories h2 {
        font-size: 2rem;
    }

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

/* Standard Phone - 480px to 599px */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .header-top {
        padding: 0.75rem 0;
    }

    .logo h1 {
        font-size: 1.375rem;
    }

    .hero {
        padding: 1.5rem 0.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

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

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .product-image {
        height: 250px;
    }

    .category-content {
        padding: 1rem;
    }

    .category-card {
        height: 300px;
    }

    .category-content h3 {
        font-size: 1.25rem;
    }

    .category-content p {
        font-size: 0.875rem;
    }

    .featured-products,
    .categories {
        padding: 2.5rem 0;
    }

    .featured-products h2,
    .categories h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .newsletter {
        padding: 2rem 0;
    }

    .newsletter-content h3 {
        font-size: 1.5rem;
    }

    .newsletter-content p {
        font-size: 0.9375rem;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-section h4 {
        font-size: 1.125rem;
    }

    .cart-sidebar {
        max-width: 100%;
    }
}

/* Small Phone - 320px to 479px */
@media (max-width: 375px) {
    .header-top {
        font-size: 0.8125rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .hero-content h2 {
        font-size: 1.375rem;
    }

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

    .btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }

    .product-info {
        padding: 0.875rem;
    }

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

    .product-price {
        font-size: 1.125rem;
    }

    .featured-products h2,
    .categories h2 {
        font-size: 1.5rem;
    }

    .category-card {
        height: 280px;
    }

    .newsletter-content h3 {
        font-size: 1.375rem;
    }
}

/* Landscape Orientation Handling */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        position: static;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero-content h2 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }

    .hero-image {
        display: none;
    }

    .category-card {
        height: 300px;
    }

    .modal {
        max-height: 85vh;
    }

    .cart-sidebar {
        width: 320px;
        max-width: 50vw;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements have minimum touch target size */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    .product-card:hover {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    /* Remove hover states on touch devices */
    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.97);
    }
}
/* ========== A11y: skip-to-content + global focus-visible ========== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #2c3e50;
    color: #fff;
    padding: 12px 20px;
    z-index: 9999;
    text-decoration: none;
    font-weight: 700;
    border-radius: 0 0 6px 0;
    transition: top 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: -3px;
}

/* Global keyboard focus indicator (only when navigating with keyboard) */
:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    border-radius: 2px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.cta-button:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3498db;
    outline-offset: 1px;
    border-color: transparent;
}
