/* ================================
   PRODUCT SECTIONS - FULLY RESPONSIVE
   ================================ */
/* ================================
   COMPLETE PRODUCT SECTION CSS
   Works on ALL devices with flip cards
   ================================ */

.product-section {
    max-width: 1400px;
    margin: clamp(40px, 8vh, 80px) auto 0;
    padding: 0 clamp(15px, 3vw, 20px);
}

.product-section h2 {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #2d5016;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #4a7c23;
    display: block;
    width: 100%;
}

.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(20px, 3vw, 30px);
    margin-top: clamp(20px, 5vh, 40px);
    justify-content: center;
}

/* ================================
   FLIP CARD STRUCTURE
   ================================ */

.product-card {
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    height: clamp(380px, 50vh, 420px);
    width: 100%;
    max-width: 300px;
    flex: 0 0 auto;
    perspective: 1000px;
}

.product-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* Hover flip for desktop */
.product-card:hover .product-card-inner {
    transform: rotateY(180deg);
}

/* Click flip for touch devices */
.product-card.flipped .product-card-inner {
    transform: rotateY(180deg);
}

.product-front,
.product-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.product-front {
    background: white;
    display: flex;
    flex-direction: column;
    transform: rotateY(0deg);
    z-index: 2;
}

.product-back {
    background: linear-gradient(135deg, #4a7c23 0%, #2d5016 100%);
    color: white;
    transform: rotateY(180deg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
}

.product-card:hover .product-front,
.product-card:hover .product-back,
.product-card.flipped .product-front,
.product-card.flipped .product-back {
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ================================
   PRODUCT CARD CONTENT
   ================================ */

.product-image {
    width: 100%;
    height: 70%;
    object-fit: contain;
    background: #f5f5f5;
    padding: 10px;
}

.product-info {
    padding: clamp(15px, 3vh, 20px);
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.product-info h3 {
    color: #2d5016;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin: 0;
}

.product-back h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin: 0 auto;
    padding: clamp(20px, 4vw, 25px) 0;
    padding-left: 15px;
    padding-right: 15px;
    color: white;
    text-align: center;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.product-back p {
    line-height: 1.8;
    font-size: clamp(0.85rem, 2vw, 1rem);
    padding: 0 clamp(20px, 4vw, 30px);
    padding-right: 15px;
    margin: 0;
    padding-bottom: clamp(15px, 3vw, 20px);
}

.product-back strong {
    display: block;
    margin-top: 0.8rem;
    color: #a3d977;
    font-size: 1.05em;
}

/* ================================
   SCROLLBAR STYLING
   ================================ */

.product-back::-webkit-scrollbar {
    width: 12px;
}

.product-back::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 10px 10px 0;
}

.product-back::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.product-back::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}

.product-back {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.3);
}

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

@media (min-width: 1441px) {
    .product-section {
        max-width: 1400px;
    }
    .product-grid {
        gap: 30px;
    }
}

@media (max-width: 1440px) {
    .product-section {
        max-width: 1200px;
    }
}

@media (max-width: 1024px) {
    .product-grid {
        gap: clamp(20px, 3vw, 25px);
    }
    .product-card {
        max-width: 280px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-card {
        max-width: 280px;
    }
    .product-section h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .product-section {
        margin-top: 40px;
    }
    .product-grid {
        gap: 20px;
    }
    .product-card {
        max-width: 100%;
    }
    .product-section h2 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .product-card {
        max-width: 350px;
    }
    .product-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .product-section {
        padding: 0 15px;
        margin-top: 30px;
    }
    .product-grid {
        gap: 15px;
    }
    .product-card {
        height: 380px;
        max-width: 100%;
    }
    .product-section h2 {
        font-size: 1.8rem;
        padding-bottom: 0.8rem;
    }
    .product-back::-webkit-scrollbar {
        width: 10px;
    }
}

@media (max-width: 360px) {
    .product-card {
        height: 360px;
    }
    .product-section h2 {
        font-size: 1.6rem;
    }
    .product-back h3 {
        font-size: 1.2rem;
        padding: 15px 12px;
    }
    .product-back p {
        font-size: 0.85rem;
        padding: 0 15px;
        padding-bottom: 12px;
    }
}

@media (max-width: 320px) {
    .product-card {
        height: 350px;
    }
    .product-section {
        padding: 0 10px;
    }
    .product-grid {
        gap: 12px;
    }
    .product-back::-webkit-scrollbar {
        width: 8px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .product-card {
        height: 350px;
    }
    .product-section {
        margin-top: 30px;
    }
    .product-grid {
        gap: 15px;
    }
}

@media (max-height: 450px) and (orientation: landscape) {
    .product-card {
        height: 320px;
    }
    .product-section h2 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .product-card {
        -webkit-tap-highlight-color: transparent;
        min-height: 380px;
    }
}

@media print {
    .product-section {
        page-break-inside: avoid;
    }
    .product-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .product-back {
        display: none;
    }
}

@media (prefers-contrast: high) {
    .product-front,
    .product-back {
        border: 2px solid #4a7c23;
    }
    .product-section h2 {
        border-bottom-width: 4px;
    }
    .product-back::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-card-inner {
        transition: none !important;
    }
    .product-card:hover .product-card-inner,
    .product-card.flipped .product-card-inner {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    .product-front {
        background: #2d2d2d;
    }
    .product-image {
        background: #1f1f1f;
    }
    .product-info {
        background: #2d2d2d;
    }
    .product-info h3 {
        color: #a3d977;
    }
    .product-section h2 {
        color: #a3d977;
        border-bottom-color: #6b9c3b;
    }
}


