/* =========================================================
   responsive.css  -  I-LOAD ITO PAGKATAPOS NG style.css
   Hindi binabago ang original CSS. Overrides lang ito.
   Phones • Tablets • Laptops • Large screens
========================================================= */

/* ---------- GLOBAL SAFETY ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    max-width: 100%;
    overflow-x: hidden;
}

img, video, svg, canvas, iframe { max-width: 100%; }

.recent-orders,
.product-table,
header nav,
.sidebar ul,
.sidebar nav {
    -webkit-overflow-scrolling: touch;
}

/* grid/flex children na hindi dapat lumampas sa screen */
.cart-layout > *,
.checkout-container > *,
.analytics > *,
.profile-page > *,
.shop-layout > *,
.contact-section > *,
.about-section > * { min-width: 0; }


/* =========================================================
   HEADER  (tablet at phone)
   Ginagawang maayos na 2-row layout: logo + icons sa taas,
   nav sa baba na pwedeng i-swipe pakaliwa/pakanan.
========================================================= */
@media (max-width: 1000px) {

    header {
        position: sticky;
        top: 0;
        height: auto !important;
        min-height: 64px;
        padding: 8px 4% !important;
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px 10px;
    }

    header .logo,
    .logo {
        position: static !important;
        transform: none !important;
        order: 1;
        width: auto !important;
        margin: 0 !important;
    }

    header .logo img,
    .logo img {
        width: 52px !important;
        height: 52px !important;
    }

    header .icons,
    .icons {
        position: static !important;
        transform: none !important;
        order: 2;
        margin: 0 0 0 auto !important;
        gap: 4px !important;
    }

    header .icons a,
    .icons a {
        width: 38px !important;
        height: 38px !important;
        font-size: 16px !important;
    }

    header nav {
        position: static !important;
        transform: none !important;
        order: 3;
        display: flex !important;           /* ipakita kahit na-hide sa maliit na screen */
        flex: 0 0 100%;
        width: 100% !important;
        margin: 0 !important;
        padding: 2px 0 4px !important;
        gap: 22px !important;
        justify-content: flex-start;
        justify-content: safe center;
        overflow-x: auto;
        scrollbar-width: none;
    }

    header nav::-webkit-scrollbar { display: none; }

    header nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 9px 0 !important;
        font-size: 13px !important;
    }

    header nav a.active::after { bottom: 0 !important; }
}

@media (max-width: 480px) {
    header { padding: 6px 3.5% !important; }

    header nav { gap: 18px !important; }

    header nav a { font-size: 12px !important; }

    /* ibalik ang search icon na tinago sa about page */
    .icons a:nth-child(1) { display: flex !important; }
}

@media (max-width: 360px) {
    header .icons a, .icons a {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}


/* =========================================================
   HOME - HERO
========================================================= */
@media (max-width: 1000px) {

    .hero {
        min-height: 520px !important;
        padding: 70px 6% !important;
    }

    .hero-text {
        width: 62% !important;
        max-width: none !important;
    }

    .hero h1 { font-size: clamp(38px, 7vw, 58px) !important; }
}

@media (max-width: 700px) {

    .hero {
        min-height: 540px !important;
        padding: 60px 6% 55px !important;
        justify-content: center;
        text-align: center;
    }

    .hero-text { width: 100% !important; }

    .hero p { margin-left: auto; margin-right: auto; }

    .hero-small { justify-content: center; }
}

@media (max-width: 380px) {
    .hero h1 { font-size: 34px !important; }
}


/* =========================================================
   HOME - FEATURED PRODUCTS
========================================================= */

/* laptop na masikip: mas maliit na text sa buttons */
@media (min-width: 1101px) and (max-width: 1300px) {

    .products .product-actions .add-to-cart,
    .products .product-btn {
        font-size: 11px !important;
        padding: 0 5px !important;
        gap: 4px !important;
    }

    .products .product-info h3 { font-size: 21px !important; }
}

/* 2 columns hanggang 561px (dati 1 column na sa 700px) */
@media (min-width: 561px) and (max-width: 1100px) {
    .products .product-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 560px) {
    .products .product-container {
        grid-template-columns: 1fr !important;
        max-width: 440px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* para hindi mag-overflow ang mga buttons sa card */
@media (max-width: 1100px) {
    .products .product-actions .add-to-cart,
    .products .product-btn {
        white-space: normal !important;
        line-height: 1.2;
    }
}


/* =========================================================
   HOME - PROMO
========================================================= */
@media (max-width: 900px) {

    .home-promo {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        padding: 30px !important;
        text-align: center;
    }

    .promo-image { height: 300px !important; }

    .promo-text p { margin-left: auto; margin-right: auto; }
}

@media (max-width: 480px) {
    .home-promo { padding: 20px !important; }
    .promo-image { height: 230px !important; }
}


/* =========================================================
   FOOTER
========================================================= */
footer { box-sizing: border-box; max-width: 100%; }

@media (min-width: 601px) and (max-width: 900px) {
    footer {
        grid-template-columns: 1fr 1fr !important;
        column-gap: 30px !important;
    }
    .footer-logo { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    footer { row-gap: 28px !important; }
}


/* =========================================================
   ABOUT PAGE
========================================================= */
@media (max-width: 1200px) {

    .feature-container {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    }
}

@media (max-width: 900px) {

    .team-container {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }

    .about-image { margin-left: auto !important; margin-right: auto !important; }
}

@media (max-width: 700px) {
    .mission { grid-template-columns: 1fr !important; }
}


/* =========================================================
   CATEGORIES / SHOP / SEARCH
========================================================= */

/* shop: 2 columns sa laptop na masikip ang sidebar */
@media (min-width: 901px) and (max-width: 1100px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .shop-sidebar { -webkit-overflow-scrolling: touch; }
}

/* search page */
@media (max-width: 700px) {
    .search-container { max-width: 100%; }
    .search-container input { min-width: 0; padding: 0 16px; }
    .search-container button { padding: 0 16px; }
}


/* =========================================================
   PRODUCT DETAILS
========================================================= */
@media (max-width: 1000px) {
    .product-benefits { flex-wrap: wrap; gap: 14px 24px; }
    .main-description { max-width: 100%; }
}

@media (max-width: 600px) {
    .action-modal { align-items: center; }
}


/* =========================================================
   CART / CHECKOUT
========================================================= */
@media (max-width: 850px) {
    .cart-layout,
    .checkout-container { grid-template-columns: 1fr !important; }

    .order-summary,
    .summary-box { position: static !important; }
}

@media (max-width: 650px) {
    .cart-item-info h3,
    .checkout-product h3 { word-break: break-word; }
}


/* =========================================================
   LOGIN / REGISTER / FORGOT / PASSWORD
========================================================= */
@media (max-width: 800px) {
    .login-container,
    .register-container { max-width: 520px; }
}

@media (max-width: 520px) {
    .password-card,
    .forgot-container { padding-left: 20px; padding-right: 20px; }
}


/* =========================================================
   CONTACT / TRACK ORDER / WISHLIST / ORDERS / GALLERY
========================================================= */
.map iframe { width: 100%; }

@media (max-width: 700px) {
    .contact-section { gap: 20px; }
    .gallery-lightbox { padding: 14px; }
    .lightbox-content { max-height: 86vh; overflow-y: auto; }
    .lightbox-prev,
    .lightbox-next { width: 42px; height: 42px; }
}

@media (max-width: 480px) {
    .gallery-filters { gap: 8px; }
    .order-actions { width: 100%; }
}


/* =========================================================
   iOS: iwas auto-zoom kapag nag-tap sa input (kailangan 16px)
========================================================= */
@media (max-width: 700px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea { font-size: 16px !important; }
}


/* =========================================================
   ADMIN PAGES (Dashboard, Orders, Products, Customers,
   Reviews, Settings) - iisang consistent na behavior
========================================================= */

/* stats cards */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .analytics { grid-template-columns: 1fr !important; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr !important; }
}

/* sidebar -> top bar na naisu-swipe */
@media (max-width: 900px) {

    .sidebar {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        padding: 12px 14px !important;
        overflow: visible !important;
        box-shadow: none !important;
    }

    .sidebar .admin-brand {
        padding: 4px 6px 12px !important;
        justify-content: flex-start !important;
    }

    .sidebar .admin-brand h2 { display: block !important; }

    .sidebar ul,
    .sidebar nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        margin: 0 !important;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sidebar ul::-webkit-scrollbar,
    .sidebar nav::-webkit-scrollbar { display: none; }

    .sidebar li {
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    .sidebar li:last-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    .sidebar li a,
    .sidebar nav a {
        flex: 0 0 auto;
        width: auto !important;
        min-height: 40px !important;
        padding: 8px 14px !important;
        justify-content: flex-start !important;
        white-space: nowrap;
        font-size: 13px !important;
    }

    .sidebar li a i,
    .sidebar nav a i {
        width: auto !important;
        font-size: 14px !important;
    }

    .dashboard {
        margin-left: 0 !important;
        padding: 18px 14px 40px !important;
    }
}

@media (max-width: 700px) {

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-profile { align-self: flex-start; }

    .settings-grid { grid-template-columns: 1fr !important; }

    .product-tools,
    .management-header { flex-direction: column; align-items: stretch; }

    .admin-search { max-width: none !important; }

    #categoryFilter { width: 100% !important; }

    .customer-tools { flex-direction: column; align-items: stretch; }
}


/* =========================================================
   MALALAKING SCREEN (1700px pataas) - hindi sobrang laki
========================================================= */
@media (min-width: 1700px) {

    .products .section-heading,
    .products .product-container {
        max-width: 1600px !important;
    }

    .home-promo { max-width: 1600px !important; }

    .hero-text { max-width: 700px; }
}


/* =========================================================
   TOUCH DEVICES - tanggalin ang hover "jump" na nakakaabala
========================================================= */
@media (hover: none) {
    .product-card:hover,
    .category-card:hover,
    .gallery-card:hover,
    .wishlist-card:hover,
    .review:hover,
    .stat-card:hover { transform: none; }
}

@media (max-width: 700px) {

    .hero-text {
        position: relative;
        z-index: 2;
        box-sizing: border-box;
        padding: 26px 20px !important;
        border-radius: 22px;
        background: rgba(251, 246, 238, .86);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        box-shadow: 0 12px 30px rgba(63, 40, 29, .18);
    }

    /* "CocoPie Creation" */
    .hero-text .hero-small {
        color: #713d25 !important;
        font-weight: 700;
    }

    /* "Enjoy the rich, creamy taste..." */
    .hero-text p {
        color: #3f281d !important;
        font-weight: 500;
        line-height: 1.6;
        text-shadow: none !important;
    }
}
