/* shop.css - Complete Modern Shop Style */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a0f1f 0%, #0f172a 50%, #1e1b4b 100%);
    min-height: 100vh;
    color: #ffffff;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ==================== */
/* HEADER STYLES */
/* ==================== */

.main-header {
    background: rgba(10, 15, 31, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
    flex-wrap: wrap;
}

/* Logo */
.logo {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #a855f7, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.5));
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    transition: width 0.3s ease;
}

.main-nav a:hover::before {
    width: 80%;
}

.main-nav a:hover {
    color: #ffffff;
    background: rgba(168, 85, 247, 0.1);
    transform: translateY(-2px);
}

/* Cart Badge */
.cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Login/Logout Buttons */
.btn-login, .btn-logout {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    padding: 8px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover, .btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, #c084fc, #a855f7);
}

.btn-login::before, .btn-logout::before {
    display: none;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 80px);
    padding-bottom: 40px;
}

/* ==================== */
/* SHOP HEADER */
/* ==================== */

.shop-header {
    text-align: center;
    padding: 40px 0 30px;
    animation: fadeInDown 0.8s ease;
}

.shop-header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #a855f7, #ec4899, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 3px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.shop-header h1::after {
    content: '🛒';
    font-size: 2.5rem;
    background: none;
    -webkit-text-fill-color: initial;
    position: absolute;
    right: -60px;
    top: -10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.shop-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== */
/* PRODUCT GRID */
/* ==================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Product Cards */
.product-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(10px);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: fadeInScale 0.6s ease backwards;
    cursor: pointer;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

/* Card Glow Effect */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.2), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.product-card:hover::before {
    left: 100%;
}

/* Card Border Animation */
.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(135deg, #a855f7, #ec4899, #fbbf24);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover::after {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.1));
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(168, 85, 247, 0.3);
}

/* Product Image */
.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Product Info */
.product-info {
    padding: 20px;
}

.product-info h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #ffffff;
    transition: all 0.3s ease;
    min-height: 50px;
}

.product-card:hover .product-info h3 {
    background: linear-gradient(135deg, #ffffff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-info .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-info .price::before {
    content: '💰';
    font-size: 1rem;
}

/* Buttons Container */
.product-info .btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Add to Cart Button */
.add-to-cart-btn {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, #c084fc, #a855f7);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

/* View Details Button */
.view-details {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.view-details:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #a855f7;
    transform: translateY(-2px);
}

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

.main-footer {
    background: rgba(10, 15, 31, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(168, 85, 247, 0.3);
    padding: 30px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}

.main-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ==================== */
/* EMPTY STATE */
/* ==================== */

.product-grid:empty::after {
    content: "🛍️ No products available";
    display: block;
    text-align: center;
    padding: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

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

/* Desktop (1200px - 1400px) */
@media screen and (max-width: 1400px) {
    .container {
        max-width: 1200px;
        padding: 0 25px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 25px;
    }
}

/* Laptop (1024px - 1199px) */
@media screen and (max-width: 1199px) {
    .shop-header h1 {
        font-size: 3rem;
    }
    
    .shop-header h1::after {
        right: -50px;
        font-size: 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 22px;
    }
}

/* Tablet Landscape (768px - 1023px) */
@media screen and (max-width: 1023px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        justify-content: center;
    }
    
    .shop-header h1 {
        font-size: 2.5rem;
    }
    
    .shop-header h1::after {
        position: static;
        display: inline-block;
        margin-left: 10px;
    }
    
    .shop-header p {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .product-card img {
        height: 180px;
    }
}

/* Tablet Portrait (600px - 767px) */
@media screen and (max-width: 767px) {
    .container {
        padding: 0 20px;
    }
    
    .header-content {
        padding: 12px 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .main-nav {
        gap: 12px;
    }
    
    .main-nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .btn-login, .btn-logout {
        padding: 6px 18px;
    }
    
    .shop-header {
        padding: 30px 0 20px;
    }
    
    .shop-header h1 {
        font-size: 2rem;
    }
    
    .shop-header h1::after {
        font-size: 1.5rem;
    }
    
    .shop-header p {
        font-size: 0.9rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
    
    .product-card img {
        height: 160px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-info h3 {
        font-size: 1rem;
        min-height: 40px;
    }
    
    .product-info .price {
        font-size: 1.1rem;
    }
    
    .add-to-cart-btn,
    .view-details {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
}

/* Mobile Large (425px - 599px) */
@media screen and (max-width: 599px) {
    .main-nav {
        gap: 8px;
    }
    
    .main-nav a {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .shop-header h1 {
        font-size: 1.8rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 15px;
    }
    
    .product-card img {
        height: 140px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-info h3 {
        font-size: 0.9rem;
        min-height: 35px;
    }
    
    .product-info .price {
        font-size: 1rem;
    }
    
    .add-to-cart-btn,
    .view-details {
        padding: 6px 12px;
        font-size: 0.75rem;
        flex: 1 1 100%;
    }
    
    .product-info .btn-group {
        flex-direction: column;
    }
}

/* Mobile Medium (375px - 424px) */
@media screen and (max-width: 424px) {
    .main-nav {
        gap: 6px;
    }
    
    .main-nav a {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .btn-login, .btn-logout {
        padding: 4px 14px;
        font-size: 0.75rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .shop-header h1 {
        font-size: 1.5rem;
    }
    
    .shop-header p {
        font-size: 0.8rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-card img {
        height: 120px;
    }
    
    .product-info h3 {
        font-size: 0.8rem;
        min-height: 30px;
    }
    
    .product-info .price {
        font-size: 0.9rem;
    }
}

/* Mobile Small (320px - 374px) */
@media screen and (max-width: 374px) {
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .product-card img {
        height: 100px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-info h3 {
        font-size: 0.75rem;
        min-height: 25px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card {
        transition: all 0.2s ease;
    }
    
    .product-card:active {
        transform: scale(0.97);
    }
    
    .add-to-cart-btn:active,
    .view-details:active {
        transform: scale(0.95);
    }
    
    .main-nav a:hover {
        transform: none;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0a0f1f 0%, #0f172a 50%, #1e1b4b 100%);
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .cart-badge {
        animation: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c084fc, #f472b6);
}

/* Selection Color */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(168, 85, 247, 0.3);
    color: #ffffff;
}