/* Custom CSS for Tokry */

/* CSS Variables */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #8e44ad;
    --accent-color: #f39c12;
    --success-color: #27ae60;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Typography */
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;
    
    /* Spacing */
    --section-padding: 80px 0;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-700);
    padding-top: 76px; /* Account for fixed navbar */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

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

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto;
    border-radius: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 30px;
    font-weight: 500;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
    background: linear-gradient(135deg, #c0392b, var(--primary-color));
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px 25px;
    font-weight: 500;
    transition: var(--transition);
}

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

/* Navigation Styles */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    padding: 0.75rem 0;
}

.navbar .container {
    max-width: 1400px;
}

.navbar-nav {
    align-items: center;
}

.navbar-collapse {
    flex-grow: 0;
}

.navbar.scrolled {
    background: var(--white) !important;
    box-shadow: var(--box-shadow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
}

.brand-text {
    font-family: var(--font-heading);
    color: var(--dark-color);
    font-weight: 700;
}

.logo-container {
    display: flex;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-700) !important;
    margin: 0 8px;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

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

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

.search-input {
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 8px 15px;
    width: 250px;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

/* Enhanced Search Functionality */
.search-filter-form {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.search-box .form-control {
    border: 2px solid var(--gray-300);
    padding: 10px 15px;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    transition: var(--transition);
}

.search-box .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: none;
}

.popular-searches {
    padding-top: 10px;
}

.popular-searches .badge {
    padding: 6px 12px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.popular-searches .badge:hover {
    background-color: var(--gray-300) !important;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gift" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23gift)"/></svg>');
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

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

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.card-text {
    color: var(--gray-600);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-item {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

/* Enhanced Product Image Consistency */
.product-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card:hover .product-thumbnail {
    transform: scale(1.03);
}

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

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Enhanced price display */
.price-section .tax-info {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-weight: normal;
}

.description-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

/* Category Styles */
.category-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.category-description {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    color: white;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.flash-messages .alert {
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Footer */
.footer {
    background: var(--dark-color) !important;
    color: var(--light-color);
}

.footer-brand h5 {
    color: var(--primary-color) !important;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-links .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--gray-700);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-links .social-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    color: white;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--gray-400);
}

.footer-badges .badge {
    margin-right: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-link {
        font-size: 0.9rem;
        margin: 0 6px;
    }
}

@media (max-width: 992px) {
    .nav-link {
        font-size: 0.95rem;
        margin: 0.25rem 0;
        padding: 0.5rem 1rem;
        white-space: normal;
    }
    
    .navbar-nav {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .search-input {
        width: 200px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
        padding: 0.75rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .search-input {
        width: 150px;
    }
    
    .hero-cta {
        gap: 0.5rem;
    }
    
    .hero-cta .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Custom Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

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

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

.shadow-custom {
    box-shadow: var(--box-shadow) !important;
}

.transition-all {
    transition: var(--transition) !important;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Admin Panel Styles */
.product-image-small {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
}

.admin-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
}

.admin-stats-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
}

.admin-stats-card .card-body {
    text-align: center;
    padding: 1.5rem;
}

.admin-stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.05);
}

.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Enhanced Image Management */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-actions {
    opacity: 1;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 8px;
    font-size: 0.75rem;
    border-radius: 0 0 8px 8px;
}

/* Image Preview Styles */
#imagePreview img {
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

#imagePreview img:hover {
    border-color: #667eea;
}

/* File Upload Enhancement */
.form-control[type="file"] {
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.form-control[type="file"]:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.form-control[type="file"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

/* ===== IMPROVED ALIGNMENT AND UX ===== */

/* Global Alignment Fixes */
.container {
    max-width: 1200px;
}

.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-auto, .col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
.col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
.col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Card Alignment */
.card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0 !important;
}

/* Button Alignment and Spacing */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Form Alignment */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Product Cards Alignment */
.product-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-item .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.product-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-thumbnail {
    transform: scale(1.05);
}

/* Navigation Alignment */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

/* Footer Alignment */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer .container {
    max-width: 1200px;
}

.footer h5 {
    color: #ecf0f1;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.footer a:hover {
    color: #667eea;
}

/* Section Spacing */
section {
    padding: 3rem 0;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* Text Alignment */
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* Flexbox Utilities */
.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-around {
    justify-content: space-around !important;
}

/* Spacing Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Responsive Improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        margin: 0.25rem 0;
    }
}

/* Photo Upload Section Improvements */
.photo-upload-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.photo-upload-section .card {
    border: 2px dashed #dee2e6;
    background: white;
}

.photo-upload-section .card:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

/* Progress Bar Improvements */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.progress-bar {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Alert Improvements */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}
