/* ===========================
   HOME PAGE STYLES (Mobile Enhanced)
   =========================== */

/* ---------------- HOME PAGE HERO (desktop default) ---------------- */
.hero-section {
    position: relative;
    width: 100%;
    height: 88vh;           /* desktop hero height (keeps the big look you liked) */
    overflow: hidden;
}

.hero-section .carousel-inner,
.hero-section .carousel-item {
    height: 100%;
}

.hero-section .carousel-item img,
.hero-section .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* keeps aspect ratio without weird stretching */
    object-position: center center;
    display: block;
}

/* Yellow block on the right */
.hero-yellow-block {
    position: absolute;
    top: 0;
    right: 0;
    width: 28%;
    height: 100%;
    background: #fabe23;
    z-index: 2;
}

/* Fixed text that sits over slides (does not move with carousel) */
.hero-fixed-text,
.hero-text {
    position: absolute;
    right: 14%;
    bottom: 18%;
    z-index: 3;
    text-align: left;
    color: #fff;
}

.hero-title {
    font-size: 88px;
    line-height: 0.95;
    font-weight: 900;
    margin: 0;
    letter-spacing: -2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.hero-sub {
    font-size: 28px;
    margin-top: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.hero-yellow { color: #fabe23; }
.hero-black  { color: #000; }

/* ---------------- INTRO SECTION ---------------- */
.intro-section .lead {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.6;
}

/* ---------------- WHY CHOOSE US ---------------- */
.why-choose .icon {
    height: 60px;
    display: inline-block;
    object-fit: contain;
}
.why-choose h5 {
    font-weight: 700;
    margin-bottom: 10px;
}

/* card style for why choose section */
.why-choose .card {
    border: none;
    border-radius: 10px;
    transition: transform .3s ease, background .25s ease, color .25s ease;
    background: transparent;
}
.why-choose .card:hover {
    transform: translateY(-6px);
    background: #ffc107; /* yellow highlight on hover */
    color: #000;
}

/* ---------------- FEATURED PRODUCTS (exact copy from products.css) ---------------- */
.products-preview .featured-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.products-preview .featured-products-grid > .home-product-card {
    flex: 0 0 calc((100% - 70px) / 3);
    max-width: calc((100% - 70px) / 3);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.home-product-card {
    background: #fff;
    border-radius: 20px;
    border: 8px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    overflow: visible;
    transition: transform .22s ease, box-shadow .22s ease, background .18s ease;
    height: 520px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.home-product-card::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: #fff;
    z-index: 10;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    pointer-events: none;
}

.home-product-card .card-body {
    padding: 26px 22px 12px 22px;
    order: 0;
    z-index: 6;
    background: transparent;
}

.home-product-card .card-body h5 {
    margin: 0 0 10px 0;
    font-weight: 900;
    font-size: 28px;
    color: #111;
    line-height: 1.02;
}

.home-product-card .card-body p {
    margin: 0;
    font-size: 15px;
    color: #333;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-product-card .card-image {
    order: 1;
    margin-top: auto;
    width: 100%;
    display: block;
    background: transparent;
    margin-bottom: -4px;
}

.home-product-card .card-image img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: contain;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.home-product-card:hover {
    background: #fabe23;
    transform: translateY(-6px);
    box-shadow: 0 22px 60px rgba(0,0,0,0.14);
}

.home-product-card:hover .card-body {
    opacity: 1;
    pointer-events: auto;
}

/* Footer overlay - EXACT copy from products.css */
.home-product-card .footer-overlay {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 36px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 90;
}

.home-product-card:hover .footer-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.home-product-card .footer-overlay .product-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.home-product-card .detail-btn {
    background: #000;
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    border: none;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    transition: color .14s ease, transform .12s ease, background .12s ease;
}

.home-product-card .detail-btn:hover {
    background: #fff;
    color: #fabe23;
    transform: translateY(-2px);
}

.home-product-card .degree-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
}

.home-product-card .degree-toggle .deg-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    transition: transform .12s ease, background .12s ease;
}

.home-product-card .degree-toggle .deg-btn.active {
    transform: scale(1.06);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.home-product-card .degree-toggle .deg-btn:hover {
    background: #fff;
    color: #fabe23;
}

/* ---------------- Utility / small tweaks ---------------- */
.section-title { font-weight: 800; margin-bottom: 18px; }
.lead { color: #333; }

/* ===========================
   ENHANCED RESPONSIVE RULES (mobile + tablet)
   Desktop design preserved, mobile dramatically improved
   =========================== */

/* Large screens (<= 1200px) */
@media (max-width: 1200px) {
    .hero-section { height: 75vh; }
    .hero-title { font-size: 72px; }
    .hero-sub { font-size: 24px; }
    .hero-yellow-block { width: 30%; }
    .hero-fixed-text { right: 16%; bottom: 16%; }
}

/* Tablets (<= 992px) */
@media (max-width: 992px) {
    .hero-section { height: 60vh; }
    .hero-section .carousel-item img { object-position: center center; }
    .hero-title { font-size: 56px; }
    .hero-sub { font-size: 20px; }
    .hero-yellow-block { width: 35%; }
    .hero-fixed-text { right: 12%; bottom: 15%; }

    /* Intro section improvements */
    .intro-section { padding: 60px 0; }
    .intro-section .lead { font-size: 16px; }

    /* Why choose us - 2 columns on tablets */
    .why-choose .row { justify-content: center; }
    .why-choose .col-md-3 { flex: 0 0 45%; max-width: 45%; margin-bottom: 20px; }
}

/* Mobile landscape / small tablets (<= 768px) */
@media (max-width: 768px) {
    .hero-section {
        height: 50vh;
        min-height: 400px; /* ensure minimum height */
    }

    /* Force all carousel images to have consistent sizing on mobile */
    .hero-section .carousel-item img,
    .hero-section .hero-image {
        height: 50vh !important;
        min-height: 400px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .hero-title {
        font-size: 40px;
        line-height: 0.9;
        letter-spacing: -1px;
    }

    .hero-sub {
        font-size: 16px;
        margin-top: 8px;
    }

    /* Hide yellow block on tablets and mobile */
    .hero-yellow-block {
        display: none;
    }

    /* Position text higher up on the image */
    .hero-fixed-text {
        right: 10%;
        bottom: 35%;
        max-width: 75%;
        text-align: right;
    }

    /* Make title fully yellow for mobile visibility */
    .hero-title .hero-black {
        color: #fabe23;
    }

    /* Enhanced shadows for readability */
    .hero-title {
        text-shadow: 0 3px 12px rgba(0,0,0,0.7);
    }

    .hero-sub {
        text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }

    /* Hide carousel navigation arrows on mobile */
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        display: none;
    }

    /* Section spacing adjustments */
    .intro-section,
    .why-choose,
    .products-preview,
    .news-section {
        padding: 40px 0;
    }

    /* Intro section mobile */
    .intro-section .row {
        flex-direction: column-reverse;
    }

    .intro-section .col-md-6:first-child {
        margin-top: 30px;
        text-align: center;
    }

    .intro-section .lead {
        font-size: 15px;
        line-height: 1.5;
    }

    .intro-section img {
        max-width: 80%;
        margin: 0 auto;
        display: block;
    }

    /* Why choose us - single column */
    .why-choose .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 25px;
    }

    .why-choose .card {
        padding: 25px 20px;
        max-width: 350px;
        margin: 0 auto;
    }

    .why-choose .icon {
        height: 50px;
    }

    /* Featured products mobile */
    .products-preview .featured-products-grid {
        gap: 20px;
    }

    .products-preview .featured-products-grid > .home-product-card {
        flex: 0 0 80%;
        max-width: 80%;
        margin-bottom: 25px;
    }

    .home-product-card {
        max-width: 300px;
        margin: 0 auto;
        height: 480px;
    }

    .home-product-card .card-image img {
        height: 240px;
    }

    /* News section mobile */
    .news-section .col-md-6 {
        margin-bottom: 20px;
    }

    .news-item {
        flex-direction: column;
        text-align: center;
    }

    .news-item img.news-thumb {
        width: 100%;
        height: 120px;
        margin-bottom: 15px;
        margin-right: 0;
    }
}

/* Mobile portrait (<= 576px) */
@media (max-width: 576px) {
    .hero-section {
        height: 45vh;
        min-height: 350px;
    }

    /* Force consistent image sizing on small mobile */
    .hero-section .carousel-item img,
    .hero-section .hero-image {
        height: 45vh !important;
        min-height: 350px !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .hero-title {
        font-size: 32px;
        line-height: 0.85;
    }

    .hero-sub {
        font-size: 14px;
        margin-top: 6px;
    }

    /* HIDE yellow block on mobile */
    .hero-yellow-block {
        display: none;
    }

    /* Reposition text higher up on the slideshow */
    .hero-fixed-text {
        right: 8%;
        bottom: 40%;
        max-width: 80%;
        padding-left: 0;
        text-align: right;
    }

    /* Make ALL text yellow on mobile for visibility */
    .hero-title .hero-black {
        color: #fabe23;
    }

    /* Enhanced text shadow for better readability over image */
    .hero-title {
        text-shadow: 0 3px 15px rgba(0,0,0,0.8);
    }

    .hero-sub {
        text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    }

    /* Hide carousel arrows on mobile */
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        display: none;
    }

    /* Container padding for mobile */
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Section spacing */
    .intro-section,
    .why-choose,
    .products-preview,
    .news-section {
        padding: 35px 0;
    }

    /* Section titles */
    .section-title {
        font-size: 24px;
        margin-bottom: 25px;
    }

    /* Intro section */
    .intro-section .lead {
        font-size: 14px;
        text-align: center;
    }

    .intro-section img {
        max-width: 90%;
    }

    /* Why choose cards */
    .why-choose .card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .why-choose .card h5 {
        font-size: 18px;
    }

    .why-choose .card p {
        font-size: 14px;
    }

    /* Featured products */
    .products-preview .featured-products-grid > .home-product-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .home-product-card {
        max-width: 280px;
        height: 400px;
        border: 4px solid #fff;
    }

    .home-product-card .card-body {
        padding: 18px;
    }

    .home-product-card .card-body h5 {
        font-size: 20px;
    }

    .home-product-card .card-body p {
        font-size: 14px;
    }

    .home-product-card .card-image img {
        height: 200px;
    }

    .home-product-card .footer-overlay {
        bottom: 12px;
        width: calc(100% - 24px);
    }

    .home-product-card .detail-btn {
        padding: 8px 15px;
        font-size: 14px;
        border-radius: 15px;
    }

    .home-product-card .degree-toggle .deg-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 12px;
    }

    /* News items */
    .news-item img.news-thumb {
        height: 100px;
    }

    .news-item h6 {
        font-size: 16px;
    }

    /* Buttons mobile optimization */
    .btn {
        padding: 12px 25px;
        font-size: 14px;
        border-radius: 25px;
    }
}

/* Extra small phones (<= 420px) */
@media (max-width: 420px) {
    .hero-section {
        height: 40vh;
        min-height: 300px;
    }

    .hero-title {
        font-size: 26px;
    }

    .hero-sub {
        font-size: 12px;
    }

    /* Yellow block already hidden from larger mobile breakpoint */
    .hero-yellow-block {
        display: none;
    }

    .hero-fixed-text {
        right: 6%;
        bottom: 15%;
        max-width: 85%;
        text-align: right;
    }

    /* Ensure full yellow text remains */
    .hero-title .hero-black {
        color: #fabe23;
    }

    /* Ultra-compact spacing */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .section-title {
        font-size: 20px;
    }

    .intro-section .lead {
        font-size: 13px;
    }

    .why-choose .card {
        padding: 18px 12px;
    }

    .why-choose .icon {
        height: 40px;
    }

    .products-preview .product-card {
        max-width: 260px;
        padding: 15px;
    }

    .products-preview .product-card img {
        max-height: 140px;
    }

    .news-item img.news-thumb {
        height: 80px;
    }
}

/* Ensure carousel controls remain functional */
.hero-section .carousel-control-prev,
.hero-section .carousel-control-next {
    width: 5%;
    opacity: 0.8;
    z-index: 4;
}

/* Touch-friendly carousel controls on mobile */
@media (max-width: 768px) {
    .hero-section .carousel-control-prev,
    .hero-section .carousel-control-next {
        width: 8%;
        opacity: 0.9;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 25px;
        height: 25px;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 576px) {
    /* Ensure text remains readable */
    .hero-title {
        text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    }

    .hero-sub {
        text-shadow: 0 1px 8px rgba(0,0,0,0.5);
    }

    /* Improve touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing for readability */
    .why-choose .card p,
    .intro-section .lead {
        line-height: 1.6;
    }
}


/* ============================================
   NEWS CARDS SECTION - Blacklion Style
   ============================================ */

/* News Section Container */
.home-news-section {
    padding: 60px 0;
    background-color: #f5f5f5;
}

.home-news-section h2 {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 40px;
    text-transform: uppercase;
}

/* News Grid - 4 columns layout */
.news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Individual News Card */
.news-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
    border-radius: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

/* News Image Container */
.news-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

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

/* News Info Block - Black background section */
.news-info {
    background-color: #000000;
    padding: 20px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color 0.3s ease;
}

.news-card:hover .news-info {
    background-color: #fabe23;
}

/* News Title */
.news-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.news-card:hover .news-title {
    color: #000000;
}

/* News Meta Container - Date and Number */
.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* News Date */
.news-date {
    color: #fabe23;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.news-card:hover .news-date {
    color: #000000;
}

/* News Order Number */
.news-number {
    color: #fabe23;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.3s ease;
}

.news-card:hover .news-number {
    color: #000000;
}

/* ============================================
   RESPONSIVE BREAKPOINTS FOR NEWS
   ============================================ */

/* Large Tablets - 3 columns */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .news-image {
        height: 220px;
    }
}

/* Tablets - 2 columns */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 0 15px;
    }

    .news-image {
        height: 200px;
    }

    .news-title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }

    .news-info {
        padding: 15px;
        min-height: 120px;
    }

    .home-news-section h2 {
        font-size: 28px;
        margin-bottom: 30px;
    }
}

/* Mobile - 1 column */
@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-image {
        height: 250px;
    }

    .news-title {
        font-size: 18px;
        -webkit-line-clamp: 3;
    }

    .news-info {
        padding: 20px;
        min-height: 140px;
    }

    .home-news-section {
        padding: 40px 0;
    }

    .home-news-section h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .news-image {
        height: 220px;
    }

    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ============================================
   VIEW ALL NEWS BUTTON
   ============================================ */

.home-news-section .btn-warning {
    background-color: #fabe23;
    border: none;
    color: #000;
    font-weight: 700;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 190, 35, 0.3);
}

.home-news-section .btn-warning:hover {
    background-color: #000;
    color: #fabe23;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.home-news-section .btn-warning:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .home-news-section .btn-warning {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* ============================================
   VIEW ALL PRODUCTS BUTTON (Same design as News button)
   ============================================ */

.products-preview .btn-warning,
.products-preview .products-btn {
    background-color: #fabe23;
    border: none;
    color: #000;
    font-weight: 700;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 190, 35, 0.3);
    display: inline-block;
    text-decoration: none;
}

.products-preview .btn-warning:hover,
.products-preview .products-btn:hover {
    background-color: #000;
    color: #fabe23;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.products-preview .btn-warning:active,
.products-preview .products-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Mobile button adjustments */
@media (max-width: 768px) {
    .products-preview .btn-warning,
    .products-preview .products-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}