/* 
 * Main CSS for Checkout Theme
 */

/* ==========================================================================
   Variables & Resets (already partly in style.css, but we will consolidate)
   ========================================================================== */
:root {
    --brand-color: #000000;
    --brand-color-rgb: 0, 0, 0;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition-speed: 0.3s;
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    --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 -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--brand-color);
    letter-spacing: -0.03em;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 32px;
    align-items: center;
}

.main-navigation a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.main-navigation a:hover {
    color: var(--brand-color);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.main-navigation a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--brand-color-primary) 0%, #004d80 100%);
    margin-bottom: 64px;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 20px 40px -10px rgba(1, 112, 185, 0.4);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.1) 0%, transparent 40%);
    animation: rotateHero 20s linear infinite;
    z-index: 1;
}

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

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.04em;
    text-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Shop Grid
   ========================================================================== */
ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-color);
}

.product-card .product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.product-card .product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-color);
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 24px;
}

.product-card .button.details-btn {
    margin-top: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 24px;
    background-color: transparent;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.product-card .button.details-btn:hover {
    background-color: var(--brand-color);
    color: #fff;
}

/* ==========================================================================
   Single Product Layout
   ========================================================================== */
.single-product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    margin-top: 48px;
    align-items: start;
}

@media (max-width: 991px) {
    .single-product-layout {
        grid-template-columns: 1fr;
        /* Swap order on mobile: image first, details second */
    }
    .single-product-details {
        order: 2;
    }
    .single-product-gallery {
        order: 1;
    }
}

.single-product-details h1.product_title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.single-product-details .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 24px;
    display: block;
}

.single-product-details .woocommerce-product-details__short-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.6;
}

.stock {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
}
.stock.in-stock {
    background-color: #dcfce7;
    color: #166534;
}
.stock.out-of-stock {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Add to Cart Form Layout */
form.cart {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    margin-top: 32px;
    margin-bottom: 48px;
    align-items: stretch;
}

/* Modern Quantity Selector (No Border) */
div.quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    width: auto;
    background-color: transparent;
}

.quantity-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 400;
    cursor: pointer;
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-speed) ease;
}

.quantity-btn:hover {
    color: var(--brand-color-primary);
}

div.quantity input[type="number"].qty {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    background: transparent;
    padding: 0;
    -moz-appearance: textfield;
}

div.quantity input[type="number"].qty::-webkit-outer-spin-button,
div.quantity input[type="number"].qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

div.quantity input[type="number"].qty:focus {
    outline: none;
}

/* Add to Cart Button with Loading State */
.single_add_to_cart_button {
    background-color: var(--brand-color);
    color: #fff;
    border: none;
    padding: 0 32px;
    height: 54px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.single_add_to_cart_button::after {
    content: "→";
    margin-left: 8px;
    font-size: 1.25rem;
    transition: transform var(--transition-speed) ease;
}

.single_add_to_cart_button:hover {
    background-color: var(--brand-color-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(1, 112, 185, 0.2);
}

.single_add_to_cart_button:hover::after {
    transform: translateX(4px);
}

.single_add_to_cart_button:active {
    transform: translateY(0);
}

.single_add_to_cart_button.loading {
    color: transparent;
}

.single_add_to_cart_button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-left: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



/* ==========================================================================
   Product Gallery (Swiper)
   ========================================================================== */
.single-product-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-swiper {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #f3f4f6;
    width: 100%;
}

.main-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* Thumbnails */
.thumbs-swiper {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.thumbs-swiper .swiper-slide {
    width: 25%;
    height: 100%;
    opacity: 0.6;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: opacity var(--transition-speed) ease;
}

.thumbs-swiper .swiper-slide-thumb-active,
.thumbs-swiper .swiper-slide:hover {
    opacity: 1;
}

.thumbs-swiper .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* ==========================================================================
   Storytelling Content Section
   ========================================================================== */
.product-storytelling-section {
    padding: 100px 0;
    margin-top: 80px;
    background-color: #fcfcfc;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.product-storytelling-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.02) 0%, transparent 100%);
    pointer-events: none;
}

.story-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.story-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.02em;
}

.story-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.story-content p {
    margin-bottom: 24px;
}

.story-content h2, .story-content h3 {
    font-weight: 700;
    color: var(--brand-color);
    margin-top: 48px;
    margin-bottom: 24px;
}

.story-content img {
    border-radius: var(--border-radius);
    margin: 32px 0;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Related Products Section
   ========================================================================== */
.related-products-section {
    padding: 80px 0;
}

.related-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-color);
    margin-bottom: 48px;
    letter-spacing: -0.03em;
}


/* ==========================================================================
   Floating Cart & Minicart
   ========================================================================== */
.floating-cart-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 64px;
    height: 64px;
    background-color: var(--brand-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
    transition: all var(--transition-bounce);
}

.floating-cart-btn:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.3);
}

.floating-cart-btn svg {
    width: 28px;
    height: 28px;
}

.floating-cart-btn .cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ef4444; /* red for visibility */
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-color);
}

/* Minicart Animation */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.floating-cart-btn.cart-updated {
    animation: popIn 0.4s var(--transition-bounce);
}

.minicart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
}

.minicart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.minicart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--card-bg);
    z-index: 1001;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.4s var(--transition-bounce);
}

.minicart-sidebar.active {
    right: 0;
}

.minicart-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.minicart-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.minicart-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-speed) ease;
    padding: 4px;
}

.minicart-close:hover {
    color: var(--brand-color);
    transform: rotate(90deg);
}

.minicart-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* WooCommerce Mini Cart Overrides */
.widget_shopping_cart_content .woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    flex-grow: 1;
    overflow-y: auto;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item {
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .remove {
    position: absolute;
    top: 32px;
    right: 8px;
    z-index: 10;
    background: #fff;
    color: #ef4444 !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 1.2rem;
    line-height: 1;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .remove:hover {
    background: #ef4444;
    color: #fff !important;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item > a:not(.remove) {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    text-align: left;
    gap: 16px;
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.125rem;
    padding-right: 32px; /* Prevent overlap with remove button */
}

.widget_shopping_cart_content .woocommerce-mini-cart-item img {
    width: 100px;
    height: 100px;
    min-width: 100px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    margin: 0;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: auto;
    margin-top: 8px;
    margin-left: 116px; /* Align under the name (100px img + 16px gap) */
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.widget_shopping_cart_content .woocommerce-mini-cart-item .quantity .amount {
    color: var(--text-color);
    font-size: 1.125rem;
}

.widget_shopping_cart_content .woocommerce-mini-cart__total {
    padding: 24px 0;
    margin: 0;
    border-top: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.widget_shopping_cart_content .woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Hide standard view cart button */
.widget_shopping_cart_content .woocommerce-mini-cart__buttons a.wc-forward:not(.checkout) {
    display: none !important;
}

.widget_shopping_cart_content .button {
    text-align: center;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1.125rem;
    transition: all var(--transition-speed) ease;
}

.widget_shopping_cart_content .button.checkout {
    background: var(--brand-color-primary);
    color: #fff;
    border: none;
}

.widget_shopping_cart_content .button.checkout:hover {
    background-color: #004d80;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(1, 112, 185, 0.2);
}


/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: #111;
    color: #fff;
    padding: 64px 0 0 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 48px;
    margin-bottom: 48px;
}

.footer-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
}

.footer-text {
    color: #a1a1aa;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #a1a1aa;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
    text-align: center;
    color: #71717a;
    font-size: 0.875rem;
}

/* ==========================================================================
   Add to Cart Success Modal
   ========================================================================== */
.cart-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--transition-bounce);
}

.cart-success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-success-modal {
    background: var(--card-bg);
    padding: 48px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s var(--transition-bounce);
}

.cart-success-overlay.active .cart-success-modal {
    transform: scale(1) translateY(0);
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px auto;
}

.checkmark {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #10b981; /* Green success color */
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: none;
}

.cart-success-overlay.active .checkmark {
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: none;
}

.cart-success-overlay.active .checkmark-circle {
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: none;
}

.cart-success-overlay.active .checkmark-check {
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 30px rgba(16, 185, 129, 0.1); }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.success-message {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.success-actions button {
    width: 100%;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-open-cart {
    background-color: var(--brand-color-primary);
    color: #fff;
    border: none;
}

.btn-open-cart:hover {
    background-color: #004d80;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(1, 112, 185, 0.2);
}

.btn-continue-shopping {
    background-color: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border-color);
}

.btn-continue-shopping:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}
