/* Modern CSS Reset & Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #2c3e50;
    --text-primary: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #bdc3c7;
    --bg-color: #ffffff;
    --card-background: #ffffff;
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background: #fafbfc;
    font-size: var(--font-size-base);
    font-display: swap; /* Prevent FOIT, improve CLS */
}

/* Container & Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Modern Header */
.main-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    text-decoration: none;
    color: var(--primary-color);
}

.logo h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo .tagline {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 400;
}

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

/* Search Box */
.search-form {
    display: flex;
    background: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.search-input {
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    width: 300px;
    outline: none;
    min-width: 200px;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--secondary-color);
    border: none;
    padding: 0.75rem 1rem;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: #2980b9;
}

/* Cart Widget */
.cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.cart-link:hover {
    background: var(--light-color);
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    gap: 0.25rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation */
.main-navigation {
    background: var(--primary-color);
    color: white;
}

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

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

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover,
.nav-item.active .nav-link {
    background: rgba(255,255,255,0.15);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▾';
    margin-left: 0.5rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
}

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

.dropdown-link {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.dropdown-link:hover {
    background: var(--light-color);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
}

.breadcrumb-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.breadcrumb-link:hover {
    color: white;
}

.breadcrumb-current {
    color: white;
    font-weight: 500;
}

.separator {
    color: rgba(255,255,255,0.6);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: var(--font-size-lg);
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.product-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease-out; /* Faster transition for better performance */
    position: relative;
    min-height: 400px; /* Prevent CLS by reserving space */
    display: flex;
    flex-direction: column;
}

.product-card-link:hover .product-card {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    will-change: transform; /* Optimize for animations */
}

.product-image {
    width: 100%;
    height: 240px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Prevent shrinking */
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.product-image picture {
    width: 100%;
    height: 100%;
    display: block;
}

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

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: var(--font-size-lg);
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

.product-price {
    font-size: var(--font-size-xl);
    color: var(--success-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-stock {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--success-color);
}

.btn-primary:hover {
    background: #229954;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Alert link styling */
.alert-link {
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

.alert-link:hover .alert {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.alert-link .alert {
    cursor: pointer;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Tables */
.modern-table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.modern-table th,
.modern-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modern-table th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--text-color);
}

.modern-table tbody tr:hover {
    background: #f8f9fa;
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: var(--font-size-lg);
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

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

.social-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.8);
}

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

.product-images {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-info h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-detail-price {
    font-size: var(--font-size-2xl);
    color: var(--success-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.product-description {
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quantity-input {
    width: 100px;
    min-width: 100px;
    text-align: center;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: var(--transition);
    -moz-appearance: textfield; /* Remove spinner Firefox */
    background: white;
}

/* Remove spinner for Chrome, Safari, Edge */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* iOS specific fix for preventing zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mobile improvements */
@media (max-width: 768px) {
    .quantity-input {
        width: 120px;
        min-width: 120px;
        padding: 1rem 1.25rem;
        font-size: 16px; /* Exactly 16px prevents iOS zoom */
        touch-action: manipulation; /* Prevent zoom on double-tap */
    }
}

/* Cart Styles */

/* Checkout Styles */
.checkout-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Success Page Styles */
.success-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.success-header {
    text-align: center;
    margin-bottom: 3rem;
}

.success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.success-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.order-confirmation-section {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.order-details-table {
    width: 100%;
    margin-bottom: 2rem;
}

.order-details-table td {
    padding: 0.5rem 0;
}

.order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.order-items-table th {
    background: var(--light-color);
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.order-items-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-items-table tfoot td {
    padding: 0.75rem 1rem;
}

.order-items-table .total-row {
    font-weight: bold;
    font-size: 1.1rem;
    border-top: 2px solid var(--text-color);
}

.email-confirmation {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: var(--border-radius);
}

.action-buttons {
    text-align: center;
    margin-top: 3rem;
}

/* Account & Auth Styles */
.account-widget {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.account-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.account-link:hover {
    background: var(--light-color);
    color: var(--secondary-color);
}

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

.auth-box {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
}

.auth-links p {
    margin-bottom: 0.5rem;
}

.auth-links a {
    color: var(--secondary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.account-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
}

.welcome-message {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

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

.account-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.account-section.full-width {
    grid-column: 1 / -1;
}

.account-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.info-box {
    background: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.info-box:last-child {
    margin-bottom: 0;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
}

.orders-table-wrapper {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.orders-table th {
    background: var(--light-color);
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.orders-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending_payment {
    background: #ffeaa7;
    color: #2d3436;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-paid {
    background: #d4edda;
    color: #155724;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-small:hover {
    background: #2980b9;
    color: white;
}

.btn-retry {
    background-color: var(--warning-color) !important;
    color: white !important;
    margin-left: 0.5rem;
}

.btn-retry:hover {
    background-color: #e67e22 !important;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.account-actions {
    text-align: center;
    margin-top: 3rem;
}

.checkout-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.checkout-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.checkout-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.checkout-section h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.street-row {
    grid-template-columns: 2fr 1fr;
}

.postal-row {
    grid-template-columns: 1fr 2fr;
}

.checkout-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    align-self: start;
}

.order-summary-table {
    width: 100%;
    margin-bottom: 1.5rem;
}

.order-summary-table td {
    padding: 0.5rem 0;
}

.summary-subtotal {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.summary-subtotal td {
    padding-top: 1rem;
}

.summary-total {
    border-top: 2px solid var(--text-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.summary-total td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.checkout-btn {
    margin-top: 2rem;
    font-size: 1.2rem;
    padding: 1rem 2rem;
}

/* Radio button styling */
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: normal;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.radio-label span {
    line-height: 1.4;
}

/* Desktop layout for checkout */
@media (min-width: 1024px) {
    .checkout-form {
        grid-template-columns: 2fr 1fr;
        gap: 3rem;
        align-items: start;
    }
    
    .checkout-sidebar {
        position: sticky;
        top: 2rem;
        height: fit-content;
    }
}

/* Mobile layout for checkout */
@media (max-width: 768px) {
    .checkout-container {
        padding: 2rem 1rem;
    }
    
    .checkout-section {
        padding: 1.5rem;
    }
    
    .checkout-section h2 {
        font-size: 1.1rem;
    }
    
    /* All form fields one per line on mobile */
    .form-row,
    .street-row,
    .postal-row {
        grid-template-columns: 1fr !important;
        gap: 0;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .checkout-sidebar {
        position: static;
    }
    
    .order-summary-table {
        font-size: 0.9rem;
    }
    
    .checkout-btn {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
}

.cart-items {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    background: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-item-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.cart-item-price {
    font-size: var(--font-size-lg);
    color: var(--success-color);
    font-weight: 600;
}

.cart-summary {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* Duplicate checkout styles removed - see line 710 for main checkout styles */

/* Page Headers */
.page-header {
    background: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: var(--font-size-3xl);
    margin: 0;
    color: var(--text-color);
}

/* Product Filters */
.products-sidebar {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: var(--font-size-lg);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-option input {
    width: auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination .current {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

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

/* Error States */
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.error-state h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-images {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .header-actions {
        order: -1;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .search-box {
        flex: 1;
        max-width: none;
    }
    
    .search-input {
        width: 100%;
        min-width: auto;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .cart-text,
    .account-text {
        display: none;
    }
    
    .nav-content {
        position: relative;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-color);
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        border-radius: var(--border-radius);
        margin-top: 0.5rem;
        z-index: 1000;
        padding: 1rem 0;
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        border-radius: 0;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 0;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        background: rgba(255,255,255,0.1);
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 300px;
        padding: 0.5rem 0;
    }
    
    .dropdown-link {
        padding: 0.75rem 2rem;
        color: rgba(255,255,255,0.9);
    }
    
    .dropdown-link:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .breadcrumbs {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .cart-item-image {
        justify-self: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h2 {
        font-size: var(--font-size-2xl);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: var(--font-size-2xl);
    }
}

/* Image Slider Styles */
.image-slider {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image.active {
    opacity: 1;
    z-index: 1;
}

.main-image img,
.main-image picture {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
}

.thumbnail-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.thumbnail-btn {
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    background: none;
}

.thumbnail-btn:hover {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.thumbnail-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
    color: var(--text-color);
    z-index: 2;
}

.slider-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: var(--shadow);
    transform: translateY(-50%) scale(1.1);
}

.slider-nav.prev {
    left: 10px;
}

.slider-nav.next {
    right: 10px;
}

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 300px;
    background: #f8f9fa;
    color: var(--text-muted);
    border-radius: var(--border-radius);
    font-size: var(--font-size-lg);
}

/* Mobile optimizations for slider */
@media (max-width: 768px) {
    .slider-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .slider-nav.prev {
        left: 5px;
    }
    
    .slider-nav.next {
        right: 5px;
    }
    
    .thumbnail-btn {
        width: 50px;
        height: 50px;
    }
    
    .thumbnail-nav {
        gap: 0.25rem;
    }
}