/* ===================================
   People's Lacrosse Store - Styles
   Design System: Dark navy/black + Cyan accent
   =================================== */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0A0A0B;
    --bg-secondary: #121214;
    --bg-tertiary: #1A1A1D;
    --accent: #00BCD4;
    --text-primary: #ffffff;
    --text-dim: #999999;
    --text-dimmer: #666666;
    --border-color: rgba(255, 255, 255, 0.08);
    --stripe-purple: #635BFF;
    
    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --border-radius-card: 16px;
    --border-radius-button: 999px;
    
    /* Safe area */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    color: var(--text-dim);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius-button);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background: #00acc4;
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-stripe {
    background: var(--stripe-purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-stripe:hover {
    background: #554dee;
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.logo:hover {
    opacity: 1;
}

.hexagon-icon {
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text-primary);
    opacity: 1;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent);
    color: var(--bg-primary);
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-count.hidden {
    display: none;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero h1 {
    color: var(--text-primary);
}

.hero-subtext {
    font-size: 1.125rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* ===================================
   Products Section
   =================================== */
.products-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    justify-content: center;
}

/* Center the last row when it has fewer items than columns */
.product-grid > .product-card:nth-last-child(1):nth-child(3n+1) {
    grid-column: 2;
}
.product-grid > .product-card:nth-last-child(2):nth-child(3n+1) {
    grid-column: 2;
}
.product-grid > .product-card:nth-last-child(2):nth-child(3n+1) ~ .product-card:last-child {
    grid-column: 3;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 188, 212, 0.3);
    box-shadow: 0 12px 40px rgba(0, 188, 212, 0.1);
}

.product-image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.price-current {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
}

.price-original {
    font-size: 1rem;
    color: var(--text-dimmer);
    text-decoration: line-through;
}

.product-add-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-button);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-add-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

/* ===================================
   About Section
   =================================== */
.about-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px 80px;
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-content p {
    font-size: 1.125rem;
    line-height: 1.8;
}

/* ===================================
   Footer
   =================================== */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
    padding-bottom: calc(40px + var(--safe-area-bottom));
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.footer-text {
    color: var(--text-dimmer);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

.footer-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ===================================
   Product Modal
   =================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

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

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 8px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-gallery {
    padding: 24px;
    border-right: 1px solid var(--border-color);
}

.main-image-container {
    margin-bottom: 16px;
}

.main-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
}

.thumbnail-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--accent);
}

.modal-details {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-title {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-price .price-current {
    font-size: 1.5rem;
}

.modal-price .price-original {
    font-size: 1.125rem;
}

.modal-reviews {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.stars {
    color: #FFD700;
}

.modal-description {
    color: var(--text-dim);
    line-height: 1.7;
}

.modal-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-features li {
    position: relative;
    padding-left: 24px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.modal-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.modal-disclaimer {
    font-size: 0.85rem;
    color: var(--text-dimmer);
    font-style: italic;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Variant Selectors */
.variant-selectors {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.variant-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variant-group label {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 500;
}

.variant-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.variant-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-button);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-btn:hover {
    border-color: var(--accent);
}

.variant-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.variant-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-selector label {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 500;
}

.quantity-selector input {
    width: 80px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
}

.quantity-selector input:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===================================
   Cart Drawer
   =================================== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 150;
    display: none;
}

.cart-overlay.active {
    display: block;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 151;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.cart-item-variant {
    font-size: 0.85rem;
    color: var(--text-dimmer);
}

.cart-item-price {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.qty-btn:hover {
    border-color: var(--accent);
}

.cart-item-qty span {
    min-width: 24px;
    text-align: center;
    font-size: 0.95rem;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-dimmer);
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: auto;
}

.remove-btn:hover {
    color: #ff4444;
}

.cart-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.continue-shopping {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.continue-shopping:hover {
    color: var(--text-primary);
}

/* Empty cart state */
.cart-empty {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-dim);
}

.cart-empty p {
    margin-bottom: 16px;
}

/* ===================================
   Stripe Modal
   =================================== */
.stripe-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
    max-width: 450px;
    width: 100%;
    padding: 32px;
    position: relative;
}

.stripe-modal-content h3 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.stripe-elements-placeholder {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.stripe-card-input {
    margin-bottom: 16px;
}

.stripe-card-input label,
.stripe-input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stripe-input-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

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

.placeholder-text {
    color: #999;
    font-size: 0.95rem;
}

.stripe-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stripe-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.stripe-disclaimer {
    text-align: center;
    color: var(--text-dimmer);
    font-size: 0.85rem;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Reset centering for 2-col layout */
    .product-grid > .product-card:nth-last-child(1):nth-child(3n+1) {
        grid-column: auto;
    }
    .product-grid > .product-card:nth-last-child(2):nth-child(3n+1) {
        grid-column: auto;
    }
    .product-grid > .product-card:nth-last-child(2):nth-child(3n+1) ~ .product-card:last-child {
        grid-column: auto;
    }
    /* 5 items in 2-col = last item alone, center it */
    .product-grid > .product-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        max-width: 50%;
        justify-self: center;
    }
    
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .hero-images {
        order: -1;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .modal-gallery {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-images {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        height: 300px;
    }
    
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
    
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
    }
    
    .main-image {
        height: 300px;
    }
    
    .stripe-modal-content {
        margin: 24px;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideIn 0.5s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
