/* ==========================================
   Traditional Medicinals Organic - Premium Design
   Modern Product Landing Page
   ========================================== */

/* ==========================================
   CSS Variables - Green Palette
   ========================================== */
:root {
    /* Primary Green Palette */
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;
    --green-950: #052e16;
    
    /* Neutral Palette */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Accent Colors */
    --gold-400: #facc15;
    --gold-500: #eab308;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-green: 0 10px 40px -10px rgba(21, 128, 61, 0.3);
    --shadow-green-lg: 0 20px 50px -12px rgba(21, 128, 61, 0.4);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
}

/* ==========================================
   Base & Reset Styles
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    line-height: var(--line-height-relaxed);
    color: var(--gray-700);
    background: linear-gradient(180deg, var(--green-50) 0%, var(--white) 30%, var(--gray-50) 100%);
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==========================================
   Background Decorative Elements
   ========================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(21, 128, 61, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 10%, rgba(34, 197, 94, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ==========================================
   Header Styles
   ========================================== */
.header {
    background: linear-gradient(135deg, var(--green-800) 0%, var(--green-700) 50%, var(--green-600) 100%);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 50%, rgba(255,255,255,0.1) 0%, transparent 30%),
        radial-gradient(circle at 90% 50%, rgba(255,255,255,0.05) 0%, transparent 25%);
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.header h1 {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    letter-spacing: -0.02em;
    font-weight: 700;
}

/* ==========================================
   Container & Layout
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   Product Section Card
   ========================================== */
.product-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 
        var(--shadow-xl),
        0 0 0 1px rgba(21, 128, 61, 0.05);
    position: relative;
    overflow: hidden;
}

.product-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--green-500), var(--green-600), var(--green-500));
}

.product-section::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(21, 128, 61, 0.02) 0%, transparent 100%);
    pointer-events: none;
}

/* ==========================================
   Gallery Styles - CSS Only
   ========================================== */
.gallery-container {
    position: relative;
}

.gallery {
    position: relative;
}

.gallery-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, var(--gray-50) 0%, var(--white) 100%);
    border: 1px solid var(--gray-200);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.02),
        var(--shadow-md);
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    opacity: 0;
    transform: scale(0.98);
    transition: 
        opacity var(--transition-base),
        transform var(--transition-base);
}

/* Gallery Image Switching - Active States */
#img1:checked ~ .gallery-main #main-img-1,
#img2:checked ~ .gallery-main #main-img-2,
#img3:checked ~ .gallery-main #main-img-3,
#img4:checked ~ .gallery-main #main-img-4 {
    opacity: 1;
    transform: scale(1);
}

/* Thumbnail Container */
.gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-start;
    padding: 8px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

/* Thumbnail Labels */
.thumb-label {
    display: block;
    width: 72px;
    height: 72px;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: 
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    background: var(--white);
}

.thumb-label:hover {
    border-color: var(--green-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.thumb-label:hover .thumb-img {
    transform: scale(1.05);
}

/* Active Thumbnail States */
#img1:checked ~ .gallery-thumbs label[for="img1"],
#img2:checked ~ .gallery-thumbs label[for="img2"],
#img3:checked ~ .gallery-thumbs label[for="img3"],
#img4:checked ~ .gallery-thumbs label[for="img4"] {
    border-color: var(--green-600);
    box-shadow: 
        0 0 0 3px rgba(21, 128, 61, 0.15),
        var(--shadow-md);
    transform: translateY(-2px);
}

/* ==========================================
   Product Info Styles
   ========================================== */
.product-info {
    position: relative;
    z-index: 1;
}

.product-info h2 {
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
    color: var(--green-800);
    position: relative;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.product-info h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--green-500), var(--green-300));
    border-radius: var(--radius-full);
}

/* Description Paragraphs */
.description p {
    margin-bottom: 16px;
    padding-left: 16px;
    position: relative;
    color: var(--gray-600);
    transition: color var(--transition-fast);
}

.description p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background: var(--green-400);
    border-radius: var(--radius-full);
}

.description p:hover {
    color: var(--gray-800);
}

.description p strong {
    color: var(--green-700);
    font-weight: 600;
}

/* Health Note Box */
.health-note {
    background: linear-gradient(135deg, var(--green-50) 0%, rgba(21, 128, 61, 0.05) 100%);
    border: 1px solid var(--green-200);
    border-left: 5px solid var(--green-600);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-top: 28px;
    position: relative;
    overflow: hidden;
}

.health-note::before {
    content: '✦';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 60px;
    color: var(--green-200);
    opacity: 0.4;
    pointer-events: none;
}

.health-note p {
    color: var(--green-800);
    font-size: 0.95rem;
    line-height: var(--line-height-relaxed);
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
}

.health-note p::before {
    display: none;
}

/* ==========================================
   CTA Section
   ========================================== */
.cta-section {
    position: relative;
    padding: 40px 0;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(21, 128, 61, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    padding: 20px 48px;
    background: linear-gradient(135deg, var(--green-600) 0%, var(--green-700) 100%);
    color: var(--white);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    border-radius: var(--radius-lg);
    box-shadow: 
        var(--shadow-green),
        inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
    transition: 
        transform var(--transition-base),
        box-shadow var(--transition-base);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        var(--shadow-green-lg),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:active {
    transform: translateY(-1px);
}

/* ==========================================
   Reviews Section
   ========================================== */
.reviews-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.reviews-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-200), transparent);
}

.reviews-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-800);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--green-100);
    display: flex;
    align-items: center;
    gap: 12px;
}

.reviews-section h3::before {
    content: '★';
    color: var(--gold-500);
    font-size: 1.25rem;
}

/* Review Cards */
.review-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--green-500);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.review-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--green-600);
}

.review-card:last-child {
    margin-bottom: 0;
}

/* Review Header */
.review-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.review-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--green-100);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    background: var(--gray-200);
}

.review-meta {
    flex: 1;
}

.review-meta p:first-child {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
    margin-bottom: 2px;
}

/* Star Ratings */
.stars {
    color: var(--gold-500);
    font-size: 1rem;
    letter-spacing: 1px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(234, 179, 8, 0.3);
}

.review-meta p:last-child {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Review Date & Specs */
.review-date {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-date::before {
    content: '✓';
    color: var(--green-500);
    font-weight: 700;
    font-size: 0.75rem;
}

.review-specs {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--green-300);
}

/* Review Text */
.review-text {
    color: var(--gray-700);
    font-size: 0.95rem;
    line-height: var(--line-height-relaxed);
}

.review-text p {
    margin: 0;
}

/* Review Attachment Photo */
.review-attachment {
    margin-top: 16px;
}

.review-photo {
    max-width: 240px;
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    object-fit: contain;
    background: var(--gray-50);
    transition: 
        transform var(--transition-base),
        box-shadow var(--transition-base);
}

.review-photo:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

/* ==========================================
   Footer Styles
   ========================================== */
.footer {
    background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 50%, var(--green-900) 100%);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-600), transparent);
}

.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(34, 197, 94, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(21, 128, 61, 0.08) 0%, transparent 30%);
    pointer-events: none;
}

.footer > div {
    position: relative;
    z-index: 1;
}

.footer p:first-child {
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--green-200);
    transition: color var(--transition-fast);
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--green-300);
    transition: width var(--transition-base);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-links span {
    color: var(--green-600);
}

.footer p:last-child {
    color: var(--green-400);
    font-size: 0.85rem;
    margin-top: 24px;
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.product-section {
    animation: fadeIn 0.5s ease-out;
}

.review-card {
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
}

.review-card:nth-child(2) {
    animation-delay: 0.1s;
}

.review-card:nth-child(3) {
    animation-delay: 0.2s;
}

.review-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* ==========================================
   Responsive Styles
   ========================================== */

/* Small devices (576px and up) */
@media (min-width: 576px) {
    .thumb-label {
        width: 80px;
        height: 80px;
    }
    
    .gallery-thumbs {
        gap: 14px;
    }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
    .gallery-main {
        max-height: 480px;
    }
    
    .review-photo {
        max-height: 250px;
        max-width: 280px;
    }
    
    .cta-button {
        font-size: 1.375rem;
        padding: 22px 56px;
    }
    
    .reviews-section {
        padding: 40px;
    }
}

/* Large devices (1024px and up) */
@media (min-width: 1024px) {
    .product-section {
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .gallery-main {
        max-height: 520px;
    }
    
    .thumb-label {
        width: 88px;
        height: 88px;
    }
    
    .product-info h2 {
        font-size: 2rem;
    }
}

/* Extra large devices (1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
    
    .product-section {
        padding: 48px;
    }
}

/* ==========================================
   Mobile Adjustments
   ========================================== */
@media (max-width: 640px) {
    body {
        font-size: 15px;
    }
    
    .header {
        padding-top: 16px;
        padding-bottom: 16px;
    }
    
    .header h1 {
        font-size: 1.125rem;
        line-height: 1.4;
        padding: 0 8px;
    }
    
    .product-section {
        border-radius: var(--radius-lg);
        padding: 20px;
        margin: 0 -8px;
    }
    
    .product-info h2 {
        font-size: 1.375rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .product-info h2::after {
        width: 40px;
        height: 3px;
    }
    
    .description p {
        font-size: 0.95rem;
        padding-left: 14px;
        margin-bottom: 14px;
    }
    
    .health-note {
        padding: 16px 18px;
        margin-top: 24px;
    }
    
    .health-note::before {
        font-size: 40px;
        top: -5px;
        right: 10px;
    }
    
    .cta-section {
        padding: 32px 0;
    }
    
    .cta-button {
        width: 100%;
        max-width: 320px;
        font-size: 1.125rem;
        padding: 18px 32px;
        border-radius: var(--radius-md);
    }
    
    .thumb-label {
        width: 64px;
        height: 64px;
    }
    
    .gallery-thumbs {
        justify-content: center;
        gap: 10px;
        padding: 6px;
    }
    
    .gallery-main {
        border-radius: var(--radius-md);
    }
    
    .gallery-image {
        padding: 12px;
    }
    
    .reviews-section {
        border-radius: var(--radius-lg);
        padding: 24px 20px;
        margin: 0 -8px;
    }
    
    .reviews-section h3 {
        font-size: 1.25rem;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .review-card {
        padding: 20px;
        border-radius: var(--radius-sm);
    }
    
    .review-avatar {
        width: 44px;
        height: 44px;
    }
    
    .review-header {
        gap: 12px;
    }
    
    .review-photo {
        max-width: 100%;
    }
    
    .footer {
        padding-top: 32px;
        padding-bottom: 32px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-links span {
        display: none;
    }
    
    .footer-links a::after {
        display: none;
    }
}

/* Very small devices */
@media (max-width: 380px) {
    .thumb-label {
        width: 56px;
        height: 56px;
    }
    
    .gallery-thumbs {
        gap: 8px;
    }
    
    .product-info h2 {
        font-size: 1.25rem;
    }
    
    .cta-button {
        font-size: 1rem;
        padding: 16px 24px;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    body {
        background: var(--white) !important;
    }
    
    body::before {
        display: none;
    }
    
    .cta-section {
        display: none;
    }
    
    .header, .footer {
        background: var(--green-700) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .product-section,
    .reviews-section {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .review-card {
        break-inside: avoid;
    }
}

/* ==========================================
   Focus & Accessibility
   ========================================== */
.thumb-label:focus-within {
    outline: 2px solid var(--green-500);
    outline-offset: 2px;
}

.cta-button:focus {
    outline: 2px solid var(--green-400);
    outline-offset: 3px;
}

.footer-links a:focus {
    outline: 1px solid var(--green-400);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}
