/* ============================================
   RANO COFFEE - Premium Navy Blue Theme
   Modern, Elegant, Professional Design
   Coffee Beans Pattern Background
   ============================================ */

:root {
    /* Primary Colors - Navy Blue Palette (RANO Coffee Theme) */
    --primary: #1e3a5f;           /* Deep Navy Blue */
    --primary-dark: #0f1f3d;      /* Dark Navy */
    --primary-light: #2d4f7a;     /* Medium Navy */
    --accent: #d4a574;            /* Warm Coffee Brown/Gold */
    --accent-hover: #e6b885;      /* Light Coffee Brown */

    /* Neutral Colors */
    --dark: #0a1628;              /* Rich Dark Blue */
    --gray-dark: #2a3f5f;         /* Dark Blue Gray */
    --gray: #5a6f8f;              /* Medium Blue Gray */
    --gray-light: #a8b8d4;        /* Light Blue Gray */
    --light: #f5f7fa;             /* Off White with Blue tint */
    --white: #FFFFFF;

    /* Semantic Colors */
    --success: #28A745;
    --danger: #DC3545;
    --warning: #FFC107;
    --info: #17A2B8;

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

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.25);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--primary-dark);
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-normal);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-dark { color: var(--dark) !important; }
.text-light { color: var(--light) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-primary-dark { background-color: var(--primary-dark) !important; }
.bg-dark { background-color: var(--dark) !important; }
.bg-light { background-color: var(--light) !important; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-weight: 500;
    font-size: 1rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--dark);
    box-shadow: var(--shadow-md);
}

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

.btn-outline {
    background: transparent;
    color: var(--light);
    border-color: var(--white);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    background: rgb(255, 255, 255) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin: 0;
    padding-top: 0;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark) !important;
    transition: all var(--transition-normal);
}

.navbar-brand:hover {
    color: var(--accent) !important;
    transform: scale(1.05);
}

.navbar-brand i {
    color: var(--accent);
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

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

.nav-link {
    color: var(--primary-dark) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transform: translateX(-50%);
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover {
    color: var(--accent) !important;
    background: rgba(212, 175, 55, 0.1);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--dark);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    animation: bounce 2s infinite;
}

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

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

.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--white);
    padding: 8rem 0 8rem;
    overflow: visible;
    margin-bottom: 0;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 1;
}

/* Wave separator - seamless with ripple animation */
.hero-section::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -12px;
    right: 0;
    width: 103%;
    height: 145px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom center;
    z-index: 2;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35))
            drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
    animation: waveRipple 8s ease-in-out infinite;
}

/* Wave ripple animation - gợn sóng */
@keyframes waveRipple {
    0%, 100% {
        transform: translateX(0) scaleY(1);
    }
    25% {
        transform: translateX(-10px) scaleY(0.98);
    }
    50% {
        transform: translateX(0) scaleY(1.02);
    }
    75% {
        transform: translateX(10px) scaleY(0.98);
    }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.hero-section .container {
    position: relative;
    z-index: 10;
}

.hero-section .row {
    position: relative;
    z-index: 10;
}

.hero-section h1 {
    color: var(--white);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 1 !important;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-section .btn {
    animation: fadeInUp 0.8s ease 0.4s both;
}

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

/* ============================================
   PRODUCT CARDS
   ============================================ */

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-card-image {
    position: relative;
    overflow: hidden;
    padding-top: 100%;
    background: var(--gray-light);
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--dark);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.product-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    transition: color var(--transition-normal);
}

.product-card:hover .product-card-title {
    color: var(--accent);
}

.product-card-category {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.product-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

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

.product-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

/* ============================================
   CATEGORY CARDS
   ============================================ */

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 250px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, transparent 100%);
    opacity: 0.7;
    transition: opacity var(--transition-normal);
}

.category-card:hover::before {
    opacity: 0.85;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.category-card-content {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--white);
}

.category-card-content h3 {
    color: var(--white);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.category-card-content p {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.category-card-content .btn {
    align-self: flex-start;
}

/* ============================================
   CART & CHECKOUT
   ============================================ */

.cart-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.cart-item:hover {
    box-shadow: var(--shadow-md);
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 100px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.cart-summary-row.total {
    border-top: 2px solid var(--primary);
    border-bottom: none;
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
}

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

.form-control,
.form-select {
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 58, 95, 0.15);
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
    animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    animation: fadeInUp var(--transition-slow);
}

.slide-in-left {
    animation: slideInLeft var(--transition-slow);
}

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

.slide-in-right {
    animation: slideInRight var(--transition-slow);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scale-in {
    animation: scaleIn var(--transition-normal);
}

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

/* Stagger animations for lists */
.stagger-animation > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.8s; }

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@media (max-width: 991px) {
    .hero-section {
        padding: 5rem 0 4rem;
    }

    .cart-summary {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 4rem 0 3rem;
    }

    .category-card {
        height: 200px;
    }

    .product-card-body {
        padding: 1rem;
    }
}

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

footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--dark) 100%);
    color: var(--light);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

footer a {
    color: var(--light);
    opacity: 0.8;
    transition: all var(--transition-normal);
}

footer a:hover {
    opacity: 1;
    color: var(--accent);
}

footer h5 {
    color: var(--accent);
    margin-bottom: 1rem;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--dark);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   MISC
   ============================================ */

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 1rem auto 0;
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-xl);
    font-weight: 500;
}

.badge-success {
    background: var(--success);
}

.badge-warning {
    background: var(--warning);
}

.badge-danger {
    background: var(--danger);
}
