/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile First Approach - Base styles are mobile */

/* === VIEWPORT META TAG REMINDER === */
/* Ensure all pages have: <meta name="viewport" content="width=device-width, initial-scale=1.0"> */

/* === GENERAL MOBILE STYLES === */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

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

/* === CONTAINER === */
.container {
    max-width: 100%;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* === HEADER MOBILE === */
.header-top {
    font-size: 0.75rem;
    padding: 0.5rem 0;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .header-top {
        font-size: 0.95rem;
        padding: 0.875rem 0;
    }
}

.header-main {
    padding: 0.75rem 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.25rem;
    flex: 1;
}

@media (min-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
}

/* Mobile Menu Toggle Button */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--primary-maroon);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (min-width: 992px) {
    .mobile-toggle {
        display: none;
    }
}

/* Mobile Navigation Menu */
.nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 1rem 0;
    z-index: 999;
}

.nav-menu.active {
    display: flex;
}

.nav-menu li {
    list-style: none;
    border-bottom: 1px solid var(--border-color);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-menu li a:hover {
    background: var(--light-maroon);
    color: var(--primary-maroon);
    padding-left: 2rem;
}

@media (min-width: 992px) {
    .nav-menu {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        box-shadow: none;
        padding: 0;
        gap: 2rem;
    }

    .nav-menu li {
        border-bottom: none;
    }

    .nav-menu li a {
        padding: 0.5rem 0;
    }

    .nav-menu li a:hover {
        padding-left: 0;
        background: transparent;
    }
}

/* === GRID SYSTEM === */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-3 {
    grid-template-columns: 1fr;
}

.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* === BUTTONS === */
.btn, .btn-primary, .btn-secondary, .btn-outline {
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    width: 100%;
    text-align: center;
}

@media (min-width: 640px) {
    .btn, .btn-primary, .btn-secondary, .btn-outline {
        width: auto;
        min-width: 200px;
    }
}

/* === CARDS === */
.card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .card {
        padding: 2rem;
        margin-bottom: 1.5rem;
    }
}

/* === PRODUCT CARDS === */
.product-card {
    padding: 1rem;
}

.product-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.product-title {
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .product-title {
        font-size: 1.25rem;
    }
}

/* === HERO SECTION === */
.hero {
    padding: 2rem 0;
}

.hero h1 {
    font-size: 1.75rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1rem;
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.25rem;
    }
}

/* === SECTIONS === */
.section {
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .section {
        padding: 4rem 0;
    }
}

/* === FORMS === */
.form-control {
    width: 100%;
    font-size: 1rem;
    padding: 0.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* === PRODUCT PAGE MOBILE === */
.amount-display .price {
    font-size: 2rem !important;
}

@media (min-width: 768px) {
    .amount-display .price {
        font-size: 3rem !important;
    }
}

/* === PAYMENT CARDS === */
.payment-method-card {
    padding: 1rem !important;
}

@media (min-width: 768px) {
    .payment-method-card {
        padding: 1.5rem !important;
    }
}

.payment-details {
    padding: 1rem !important;
}

@media (min-width: 768px) {
    .payment-details {
        padding: 1.5rem !important;
    }
}

/* === TABLES === */
table {
    width: 100%;
    overflow-x: auto;
    display: block;
}

@media (min-width: 768px) {
    table {
        display: table;
    }
}

/* === TEXT ALIGNMENT === */
.text-center {
    text-align: center;
}

@media (max-width: 640px) {
    .mobile-text-center {
        text-align: center;
    }
}

/* === SPACING UTILITIES === */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

@media (min-width: 768px) {
    .mb-md-2 { margin-bottom: 1rem; }
    .mb-md-3 { margin-bottom: 1.5rem; }
    .mb-md-4 { margin-bottom: 2rem; }
}

/* === HIDE/SHOW ON MOBILE === */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* === FOOTER === */
.footer {
    padding: 2rem 0 1rem;
}

.footer-content {
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        flex-direction: row;
        gap: 3rem;
    }
}

/* === PRICING GRID === */
.pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
}

@media (min-width: 640px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === TOUCH TARGETS === */
/* Ensure all interactive elements are at least 44x44px for touch */
button, a.btn, input[type="submit"], input[type="button"] {
    min-height: 44px;
}

/* === PREVENT TEXT OVERFLOW === */
h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* === RESPONSIVE IMAGES IN CARDS === */
.card img, .product-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === PRODUCT PAGE SPECIFICS === */
@media (max-width: 991px) {
    .grid-2 {
        gap: 2rem;
    }
}

/* === ADMIN PANEL MOBILE === */
.admin-container {
    padding: 1rem;
}

@media (min-width: 768px) {
    .admin-container {
        padding: 2rem;
    }
}

/* === WHATSAPP BUTTON MOBILE === */
.whatsapp-button {
    font-size: 1rem !important;
    padding: 0.875rem 1.5rem !important;
}

@media (min-width: 768px) {
    .whatsapp-button {
        font-size: 1.2rem !important;
        padding: 1rem 2rem !important;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === LANDSCAPE MOBILE === */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
    }

    .section {
        padding: 1.5rem 0;
    }
}

/* === FORCE SINGLE COLUMN ON MOBILE - AGGRESSIVE OVERRIDES === */
@media (max-width: 639px) {
    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    div[class*="grid"],
    .books-grid,
    .product-grid,
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: grid !important;
    }

    /* Ensure category cards stack */
    .category-card {
        width: 100% !important;
    }
}
