/* ========================================
   Kristal Optik - Custom Stylesheet
   Modern Eyewear Boutique Design
   ======================================== */

/* === Root Variables === */
:root {
    --primary: #2D3436;
    --accent: #6C5CE7;
    --accent-dark: #5A4BD1;
    --secondary: #00CEC9;
    --secondary-dark: #00B5B0;
    --light: #F8F9FA;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
}

/* === Smooth Scroll === */
html {
    scroll-behavior: smooth;
}

/* === Selection Color === */
::selection {
    background-color: #6C5CE7;
    color: white;
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F8F9FA;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #6C5CE7, #00CEC9);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5A4BD1;
}

/* === Glass Morphism Effects === */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(45, 52, 54, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Lens-Themed Decorative Elements === */
.lens-circle {
    position: relative;
}
.lens-circle::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border: 2px solid rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    top: -50px;
    right: -100px;
    pointer-events: none;
}
.lens-circle::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(0, 206, 201, 0.1);
    border-radius: 50%;
    bottom: -30px;
    left: -60px;
    pointer-events: none;
}

/* === Lens Flare Effect === */
.lens-flare {
    position: relative;
    overflow: hidden;
}
.lens-flare::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(108, 92, 231, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* === Spectacle Frame Border === */
.frame-border {
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}
.frame-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #6C5CE7, #00CEC9);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.frame-border:hover::before {
    opacity: 1;
}

/* === Gradient Text === */
.gradient-text {
    background: linear-gradient(135deg, #6C5CE7, #00CEC9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Gradient Border === */
.gradient-border {
    position: relative;
    border-radius: 1rem;
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #6C5CE7, #00CEC9);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* === Hero Section === */
.hero-gradient {
    background: linear-gradient(135deg, #2D3436 0%, #1a1f21 40%, #2D3436 100%);
}

.hero-pattern {
    background-image:
        radial-gradient(circle at 20% 50%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 206, 201, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(108, 92, 231, 0.08) 0%, transparent 40%);
}

/* === Animated Gradient === */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animated-gradient {
    background: linear-gradient(-45deg, #6C5CE7, #00CEC9, #5A4BD1, #00B5B0);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* === Float Animation === */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

/* === Pulse Glow === */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 92, 231, 0.3); }
    50% { box-shadow: 0 0 40px rgba(108, 92, 231, 0.6); }
}

.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* === Shimmer Effect === */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.shimmer {
    position: relative;
    overflow: hidden;
}
.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

/* === Card Hover Effects === */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.card-lift {
    transition: all 0.3s ease;
}
.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(108, 92, 231, 0.15);
}

/* === Image Zoom on Hover === */
.img-zoom {
    overflow: hidden;
}
.img-zoom img,
.img-zoom .zoom-target {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.img-zoom:hover img,
.img-zoom:hover .zoom-target {
    transform: scale(1.08);
}

/* === Brand Logo Styling === */
.brand-logo {
    filter: grayscale(100%) opacity(0.5);
    transition: all 0.4s ease;
}
.brand-logo:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

/* === Section Divider === */
.section-divider {
    position: relative;
}
.section-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #6C5CE7, #00CEC9);
    border-radius: 2px;
}

/* === Eyeglass Icon Decorations === */
.eyeglass-decoration {
    position: relative;
}
.eyeglass-decoration::before,
.eyeglass-decoration::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 30px;
    border: 2px solid rgba(108, 92, 231, 0.1);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}
.eyeglass-decoration::before {
    left: -80px;
}
.eyeglass-decoration::after {
    right: -80px;
}

/* === Tab Styles === */
.tab-btn {
    position: relative;
    transition: all 0.3s ease;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #6C5CE7, #00CEC9);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.tab-btn:hover::after,
.tab-btn.active::after {
    width: 100%;
}
.tab-btn.active {
    color: #6C5CE7;
    font-weight: 600;
}

/* === Product Card === */
.product-card {
    position: relative;
    border-radius: 1rem;
    background: white;
    overflow: hidden;
    transition: all 0.4s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.product-card .product-image {
    position: relative;
    overflow: hidden;
}
.product-card .product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(45, 52, 54, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}
.product-card:hover .product-overlay {
    opacity: 1;
}

/* === Testimonial Card === */
.testimonial-card {
    position: relative;
}
.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    font-family: 'Playfair Display', serif;
    color: rgba(108, 92, 231, 0.1);
    line-height: 1;
}

/* === Form Styling === */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}
.form-input:focus {
    border-color: #6C5CE7;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
    outline: none;
}

/* === Badge Styles === */
.badge-new {
    background: linear-gradient(135deg, #6C5CE7, #00CEC9);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
}
.badge-sale {
    background: linear-gradient(135deg, #e74c3c, #e67e22);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* === Stat Counter === */
.stat-item {
    text-align: center;
    padding: 1.5rem;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6C5CE7, #00CEC9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Loading Skeleton === */
@keyframes loadingPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0, #f1f5f9, #e2e8f0);
    background-size: 200% 100%;
    animation: loadingPulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

/* === Hamburger Menu Animation === */
.hamburger-icon.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-icon.is-active span:nth-child(2) {
    opacity: 0;
}
.hamburger-icon.is-active span:nth-child(3) {
    width: 1.5rem;
    transform: translateY(-4px) rotate(-45deg);
}

/* === Responsive Typography === */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.25rem;
    }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
}
@media (min-width: 1025px) {
    .hero-title {
        font-size: 4rem;
    }
}

/* === Print Styles === */
@media print {
    nav, footer, .fixed, .fab {
        display: none !important;
    }
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
}

/* ============================================
   Responsive Overflow & Text Protection
   ============================================ */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Break long words/URLs to prevent overflow */
body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

p, li, td, th, span, a, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
table {
    max-width: 100%;
}

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Prevent pre/code blocks from overflowing */
pre, code {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

