/**
 * Custom CSS - Westpool E-Commerce
 * Additional styling and components beyond Tailwind defaults
 */

/* Color variables */
:root {
    --primary: #1e3a5f;
    --primary-light: #2980b9;
    --secondary: #34495e;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --muted: #95a5a6;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============ HEADER & NAVIGATION ============ */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-light);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-light);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--secondary);
    transition: color 0.3s ease;
}

.cart-icon:hover {
    color: var(--primary-light);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
}

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

/* ============ FOOTER ============ */

.footer {
    background: var(--dark);
    color: white;
    padding: 3rem 1rem 2rem;
    margin-top: 4rem;
}

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

.footer-column h4 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-column a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 2rem 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* ============ PRODUCT CARD (Modern Shared) ============ */

.product-card {
    background: #fff;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: none;
    transition: all .4s cubic-bezier(.22,.61,.36,1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 20px 48px rgba(30,58,95,.12);
    transform: translateY(-8px);
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .5s cubic-bezier(.22,.61,.36,1);
}

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

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 10;
    background: var(--accent);
    color: white;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(231,76,60,.25);
}

.product-info {
    padding: 1.375rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    letter-spacing: -.01em;
}

.product-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    color: #f39c12;
}

.product-rating i {
    font-size: 0.875rem;
}

.product-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: auto;
}

.product-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s ease;
    font-size: 0.86rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-btn.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.product-btn.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30,58,95,.22);
}

.product-btn.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid rgba(30,58,95,.15);
}

.product-btn.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============ HERO SECTION ============ */

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero-content h1 {
    color: white;
    margin-bottom: 1rem;
}

.hero-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

/* ============ PAGINATION ============ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.pagination .active {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

/* ============ FORMS ============ */

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

/* ============ MODALS ============ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .nav-links {
        display: none;
        gap: 1rem;
        flex-direction: column;
    }

    .hamburger {
        display: flex;
    }

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

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }

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

    h1 {
        font-size: 1.875rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* ============ BREADCRUMB ============ */

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

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

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #999;
}

/* ============ ALERTS ============ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

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

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-icon {
    font-size: 1.25rem;
}

/* ============ LOADING STATE ============ */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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