/* 
 * LA'REALEZA - Comprehensive Responsive CSS
 * Mobile-first responsive design for all public pages
 * Breakpoints: Mobile (320px+), Tablet (768px+), Desktop (1024px+), Large (1200px+)
 */

/* ==================== BASE RESPONSIVE SETUP ==================== */
* {
    box-sizing: border-box;
}

.container-fluid {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

/* Container max-widths for different breakpoints */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ==================== HEADER RESPONSIVE ==================== */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 15px;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3a86ff;
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.site-nav a:hover {
    color: #3a86ff;
}

/* Mobile navigation */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .site-nav {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        gap: 1rem;
    }
    
    .site-nav.active {
        display: flex;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .site-header .container {
        padding: 0.75rem 15px;
    }
    
    .brand {
        font-size: 1.25rem;
    }
}

/* ==================== GRID SYSTEM ==================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col {
    flex: 1 0 0%;
    padding-left: 15px;
    padding-right: 15px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }

/* Responsive columns */
@media (min-width: 576px) {
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
    .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

@media (min-width: 1200px) {
    .col-xl-12 { flex: 0 0 100%; max-width: 100%; }
    .col-xl-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
    .col-xl-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
    .col-xl-9 { flex: 0 0 75%; max-width: 75%; }
    .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-xl-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-xl-6 { flex: 0 0 50%; max-width: 50%; }
    .col-xl-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-3 { flex: 0 0 25%; max-width: 25%; }
    .col-xl-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-xl-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
}

/* ==================== RESPONSIVE GRIDS ==================== */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-responsive {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .grid-responsive-sm-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-responsive-sm-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .grid-responsive-md-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-responsive-md-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-responsive-md-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 992px) {
    .grid-responsive-lg-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-responsive-lg-4 { grid-template-columns: repeat(4, 1fr); }
    .grid-responsive-lg-5 { grid-template-columns: repeat(5, 1fr); }
}

.grid-auto-fit {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-auto-fit-lg {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-auto-fit-sm {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ==================== RESPONSIVE TABLES ==================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .table {
        min-width: 500px;
    }
    
    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 0.875rem;
    }
}

/* Mobile-friendly table alternative */
.mobile-table {
    display: none;
}

@media (max-width: 768px) {
    .desktop-table {
        display: none;
    }
    
    .mobile-table {
        display: block;
    }
    
    .mobile-table-item {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .mobile-table-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }
    
    .mobile-table-label {
        font-weight: 600;
        color: #6b7280;
        font-size: 0.875rem;
    }
    
    .mobile-table-value {
        font-weight: 500;
        text-align: right;
    }
}

/* ==================== FORMS RESPONSIVE ==================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3a86ff;
    box-shadow: 0 0 0 3px rgba(58, 134, 255, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        min-width: unset;
    }
    
    .form-control {
        padding: 0.625rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ==================== BUTTONS RESPONSIVE ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly */
}

.btn-primary {
    background: #3a86ff;
    color: white;
    border-color: #3a86ff;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-outline {
    background: transparent;
    color: #3a86ff;
    border-color: #3a86ff;
}

.btn-outline:hover {
    background: #3a86ff;
    color: white;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .btn-block {
        width: 100%;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* ==================== CARDS RESPONSIVE ==================== */
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

@media (max-width: 768px) {
    .card-header,
    .card-footer {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* ==================== UTILITY CLASSES ==================== */
/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Responsive display */
@media (max-width: 575px) {
    .d-xs-none { display: none !important; }
    .d-xs-block { display: block !important; }
    .d-xs-flex { display: flex !important; }
}

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* Flex utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 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; }

/* Text utilities */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

@media (max-width: 768px) {
    .text-md-center { text-align: center !important; }
    .text-md-left { text-align: left !important; }
}

/* Width utilities */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }

/* Height utilities */
.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }

/* ==================== RESPONSIVE IMAGES ==================== */
.img-responsive {
    max-width: 100%;
    height: auto;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== RESPONSIVE SECTIONS ==================== */
.section {
    padding: 3rem 0;
}

@media (max-width: 768px) {
    .section {
        padding: 2rem 0;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 1.5rem 0;
    }
}

/* ==================== PRODUCT GRIDS ==================== */
.products-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* Product cards */
.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

@media (max-width: 480px) {
    .product-image {
        height: 150px;
    }
}

.product-info {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3a86ff;
    margin-bottom: 0.75rem;
}

@media (max-width: 480px) {
    .product-info {
        padding: 0.75rem;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
}

/* ==================== MOBILE FIRST OVERRIDES ==================== */
@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.875rem; }
}

/* ==================== MAIN NAVIGATION STYLES ==================== */
.main-nav {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-dark);
}

.nav-brand img {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.nav-brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

.brand-accent {
    color: #ff6b35;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0 2rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.featured {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-notification,
.nav-cart {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-notification:hover,
.nav-cart:hover {
    background: var(--background-light);
    color: var(--primary-color);
}

.nav-notification .badge,
.nav-cart .badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 50px;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav {
    display: none;
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-nav-link {
    display: block;
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.75rem 0;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--primary-color);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link.featured {
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-nav-featured,
.mobile-nav-cta {
    margin: 0.75rem 0;
    text-align: center;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-links,
    .nav-actions {
        display: none;
    }
    
    .mobile-nav-toggle {
        display: block;
    }
    
    .mobile-nav.active {
        display: block;
    }
    
    .nav-container {
        height: 60px;
        padding: 0 1rem;
    }
    
    .nav-brand-text h1 {
        font-size: 1.125rem;
    }
    
    .nav-brand img {
        width: 35px;
        height: 35px;
    }
}

/* ==================== SHOP-SPECIFIC STYLES ==================== */
/* Shop navigation enhancements */
.main-nav .btn.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-link.featured {
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-nav-featured {
    margin: 0.75rem 0;
}

.mobile-nav-cta {
    margin-top: 1rem;
}

.search-section {
    background: var(--background-light);
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.search-form {
    max-width: 48rem;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    outline: none;
    font-size: 0.875rem;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-button {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: var(--primary-dark);
}

.search-button i {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .search-section {
        padding: 1rem 0;
    }
    
    .search-input-group {
        margin: 0 1rem;
    }
    
    .search-button {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}