/* ============================================
   MODERN CATEGORY PAGE - OPTIMIZED & CLEAN
   Last Updated: January 18, 2026
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
    --color-primary: #2c3e50;
    --color-secondary: #667eea;
    --color-tertiary: #a0aec0;
    --color-white: #ffffff;
    --color-success: #25D366;
    --card-radius: 12px;
    --card-height: 180px;
    --transition-speed: 0.3s;
}

/* ============================================
   CATEGORY HEADER - GRADIENT DESIGN
   ============================================ */

.category-header-gradient-wrap {
    margin: 40px auto 35px auto;
    max-width: 800px;
    padding: 0 20px;
}

.category-header-gradient-border {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px;
    padding: 3px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.category-header-gradient-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 18px;
    padding: 30px 35px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

/* ============================================
   SUBCATEGORY GRADIENT CARDS
   ============================================ */

.category-gradient-section {
    margin: 0 0 30px 0;
    padding: 0 20px;
}

.category-gradient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.ccs-traceWrap {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2.5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ccs-traceWrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
}

.ccs-traceCard {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 14px;
    padding: 18px 14px;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-card-text {
    color: #fff;
    font-size: clamp(13px, 2vw, 15px);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    font-family: 'Barlow', sans-serif;
}

.ccs-traceWrap:hover .category-card-text {
    color: #f093fb;
}

/* Gradient Animation */
@keyframes ccs-rotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.ccs-traceWrap:hover {
    animation: ccs-rotate 3s linear infinite;
}

/* Register gradient as animatable property */
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@property --gradient-color-1 {
    syntax: "<color>";
    initial-value: #667eea;
    inherits: false;
}

@property --gradient-color-2 {
    syntax: "<color>";
    initial-value: #764ba2;
    inherits: false;
}

/* ============================================
   MATERIAL DESIGN GRID LAYOUT
   ============================================ */

#content .row.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 0 0 40px 0;
}

#content .row.product-grid::before,
#content .row.product-grid::after {
    content: none;
    display: none;
}

/* Force product cards to work with CSS Grid */
.product-layout,
.product-layout.product-list,
.product-layout.col-xs-12,
#content .product-layout {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    display: block !important;
}

.card-info .card-title-link {
    color: inherit;
    text-decoration: none;
}

.card-info .card-title-link:hover {
    color: var(--color-secondary);
}

/* ============================================
   MATERIAL DESIGN HORIZONTAL CARD
   ============================================ */

.mdc-card.bottom-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: var(--card-height);
    border-radius: var(--card-radius);
    background-color: var(--color-primary);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    animation: revealCard 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    animation-fill-mode: backwards;
    position: relative;
}

.mdc-card.bottom-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    transform: translateY(-4px);
}

/* Card First Half (Image Section) */
.bottom-card .first-half {
    height: 100%;
    width: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--card-radius);
    position: relative;
    overflow: hidden;
}

/* Top Card (Floating Image) */
.media-image.top-card {
    width: 140px;
    height: 140px;
    z-index: 2;
    margin-left: -70px;
    background-color: var(--color-secondary);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all var(--transition-speed) ease;
}

.bottom-card:hover .media-image.top-card {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.media-image.top-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Card Last Half (Info Section) */
.bottom-card .last-half {
    height: 100%;
    width: 55%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Card Info */
.card-info {
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-info h2 {
    font-weight: 700;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    color: var(--color-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px;
}

.card-info h4 {
    font-weight: 600;
    font-size: 20px;
    font-family: 'Barlow', sans-serif;
    color: var(--color-white);
    margin: 0;
}

/* WhatsApp Button */
.card-info .btn-whatsapp {
    background: var(--color-success);
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    text-decoration: none;
}

.card-info .btn-whatsapp:hover {
    background: #20ba5a;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: var(--color-white);
    text-decoration: none;
}

.card-info .btn-whatsapp i {
    font-size: 16px;
}

/* ============================================
   LEGACY SUPPORT (Hidden - Not Used)
   ============================================ */

.product-thumb {
    display: none !important;
}

.result-pagination {
    display: none !important;
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */

.load-more-section {
    margin: 50px 0 40px 0;
    text-align: center;
}

.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.load-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Barlow', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
}

.load-more-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.load-more-button:active {
    transform: translateY(-1px);
}

.load-more-button svg {
    animation: bounceArrow 1.5s ease-in-out infinite;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.load-more-spinner {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-size: 15px;
    font-family: 'Barlow', sans-serif;
}

.load-more-spinner .spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delays */
.product-layout:nth-child(1) .mdc-card { animation-delay: 0.05s; }
.product-layout:nth-child(2) .mdc-card { animation-delay: 0.1s; }
.product-layout:nth-child(3) .mdc-card { animation-delay: 0.15s; }
.product-layout:nth-child(4) .mdc-card { animation-delay: 0.2s; }
.product-layout:nth-child(5) .mdc-card { animation-delay: 0.25s; }
.product-layout:nth-child(6) .mdc-card { animation-delay: 0.3s; }
.product-layout:nth-child(7) .mdc-card { animation-delay: 0.35s; }
.product-layout:nth-child(8) .mdc-card { animation-delay: 0.4s; }

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Override responsive.css for 590-767px */
@media (min-width: 590px) and (max-width: 767px) {
    #content .row.product-grid,
    #content .row.product-grid.row {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    .product-layout,
    .product-layout.product-list,
    .product-layout.product-grid,
    .product-layout.col-xs-12 {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }
}

/* Override responsive.css for 480-590px */
@media (min-width: 480px) and (max-width: 589px) {
    #content .row.product-grid,
    #content .row.product-grid.row {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    .product-layout,
    .product-layout.product-list,
    .product-layout.product-grid,
    .product-layout.col-xs-12 {
        width: 100% !important;
        float: none !important;
        display: block !important;
    }
}

/* Mobile: Single column - Same design as desktop */
@media (max-width: 767px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #content {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Force single column */
    #content .row.product-grid,
    #content .row.product-grid.row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .product-layout,
    .product-layout.col-xs-12,
    .product-layout.col-sm-12,
    #content .product-layout {
        width: 100% !important;
        float: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    
    /* Keep same design as desktop - only stack vertically */
    .mdc-card.bottom-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        height: var(--card-height);
        border-radius: var(--card-radius);
        background-color: var(--color-primary);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        min-height: 180px;
    }

    .mdc-card.bottom-card:hover {
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
        transform: translateY(-4px);
    }
    
    .bottom-card .first-half {
        height: 100%;
        width: 45%;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--card-radius);
        position: relative;
        overflow: hidden;
    }
    
    .media-image.top-card {
        width: 140px;
        height: 140px;
        z-index: 2;
        margin-left: -70px;
        background-color: var(--color-secondary);
        border-radius: var(--card-radius);
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        transition: all var(--transition-speed) ease;
    }

    .bottom-card:hover .media-image.top-card {
        transform: scale(1.05) rotate(2deg);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    }
    
    .media-image.top-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    .bottom-card .last-half {
        height: 100%;
        width: 55%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: 20px;
        position: relative;
    }
    
    .card-info {
        width: 100%;
        text-align: left;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .card-info h2 {
        font-weight: 700;
        font-size: 16px;
        font-family: 'Montserrat', sans-serif;
        color: var(--color-secondary);
        line-height: 1.4;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 44px;
    }
    
    .card-info h4 {
        font-weight: 600;
        font-size: 20px;
        font-family: 'Barlow', sans-serif;
        color: var(--color-white);
        margin: 0;
    }
    
    .card-info .btn-whatsapp {
        background: var(--color-success);
        color: var(--color-white);
        border: none;
        padding: 10px 20px;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-speed) ease;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 8px;
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
        text-decoration: none;
        width: auto;
        max-width: 100%;
    }
    
    .card-info .btn-whatsapp:hover {
        background: #20ba5a;
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
        color: var(--color-white);
        text-decoration: none;
    }
    
    .card-info .btn-whatsapp i {
        font-size: 16px;
    }
    
    /* Category header - Mobile */
    .category-header-gradient-wrap {
        margin: 25px auto 22px auto;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .category-header-gradient-border {
        border-radius: 16px;
        padding: 2.5px;
    }
    
    .category-header-gradient-card {
        border-radius: 14px;
        padding: 20px 18px;
        min-height: 60px;
    }
    
    .category-header-title {
        font-size: clamp(18px, 5vw, 26px);
        letter-spacing: 0.3px;
    }
    
    /* Subcategory cards - Mobile */
    .category-gradient-section {
        margin: 0 0 20px 0;
        padding: 0;
    }
    
    .category-gradient-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .ccs-traceWrap {
        border-radius: 14px;
        padding: 2px;
    }
    
    .ccs-traceCard {
        border-radius: 13px;
        padding: 14px 10px;
        min-height: 55px;
    }
    
    .category-card-text {
        font-size: clamp(11px, 2.5vw, 13px);
        font-weight: 600;
    }
    
    #content {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Load More Button - Mobile */
    .load-more-section {
        margin: 30px 10px 40px 10px;
    }
    
    .load-more-button {
        padding: 14px 28px;
        font-size: 13px;
        min-width: 200px;
    }
    
    .load-more-button svg {
        width: 18px;
        height: 18px;
    }
    
    .load-more-spinner {
        font-size: 14px;
    }
    
    .load-more-spinner .spinner {
        width: 20px;
        height: 20px;
        border-width: 2.5px;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    #content .row.product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Desktop: 2 columns */
@media (min-width: 992px) and (max-width: 1199px) {
    #content .row.product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Large Desktop: 2-3 columns */
@media (min-width: 1200px) {
    #content .row.product-grid {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 24px;
    }
    
    /* Sidebar Active */
    #column-left + #content .row.product-grid,
    #content + #column-right .row.product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Sidebar Active: Base styles */
#column-left + #content .row.product-grid,
#content + #column-right .row.product-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

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

.card-info .btn-whatsapp:focus {
    outline: 3px solid var(--color-secondary);
    outline-offset: 3px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

#content p:only-child {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    font-size: 18px;
    color: #757575;
}
