/* CSS Flexbox 반응형 레이아웃 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2f2f2f;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Best Items & New Items Section */
.best-items,
.new-items {
    padding: 80px 20px;
    background: #fff;
}

.new-items {
    background: #f8f8f8;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #2f2f2f;
    margin-bottom: 50px;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #b4252d;
}

/* Items Flexbox - 기본: 3열 */
.items-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

.items-flex .item {
    flex: 0 0 calc(33.333% - 20px); /* 3열: 각각 33.333% 너비, gap 고려 */
    min-width: 0; /* flex 아이템이 줄어들 수 있도록 */
}

.item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.item:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.item-image {
    position: relative;
    overflow: hidden;
    padding-top: 133.33%; /* 3:4 aspect ratio */
}

.item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item:hover .item-image img {
    transform: scale(1.1);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item:hover .item-overlay {
    opacity: 1;
}

.btn-view {
    padding: 12px 30px;
    background: #b4252d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-view:hover {
    background: #8d1d24;
}

.item-info {
    padding: 20px;
    text-align: center;
    position: relative;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #2f2f2f;
    margin: 0 0 10px;
}

.item-price {
    font-size: 16px;
    font-weight: 700;
    color: #b4252d;
    margin: 0;
}

.badge-new {
    position: absolute;
    top: -35px;
    right: 15px;
    background: #b4252d;
    color: #fff;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Footer */
.footer {
    background: #2f2f2f;
    color: #fff;
    padding: 60px 20px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Footer Flexbox - 기본: 4열 */
.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    flex: 1 1 auto;
    min-width: 0;
}

.footer-about {
    flex: 2 1 300px; /* 2배 크기, 최소 300px */
}

.footer-links,
.footer-info {
    flex: 1 1 200px; /* 1배 크기, 최소 200px */
}

.footer-contact {
    flex: 1.5 1 250px; /* 1.5배 크기, 최소 250px */
}

.footer-section h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-about p {
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    display: block;
    width: 25px;
    height: 25px;
    background: #555;
    text-align: center;
    line-height: 25px;
    border-radius: 3px;
    transition: opacity 0.3s;
}

.footer-social a:hover {
    opacity: 0.7;
}

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

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

.footer-links a,
.footer-info a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
}

.footer-links a:hover,
.footer-info a:hover {
    color: #b4252d;
}

.footer-contact p {
    line-height: 1.8;
    color: #ccc;
    font-size: 14px;
}

.footer-contact strong {
    color: #fff;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

/* ============================================
   반응형 디자인 (Responsive Design)
   ============================================ */

/* 태블릿 (1200px 이하) */
@media screen and (max-width: 1200px) {
    .items-flex {
        gap: 25px;
    }
    
    .items-flex .item {
        flex: 0 0 calc(33.333% - 17px); /* gap 조정 */
    }
    
    .footer-content {
        gap: 30px;
    }
}

/* 태블릿 (1024px 이하) - 2열 */
@media screen and (max-width: 1024px) {
    .items-flex .item {
        flex: 0 0 calc(50% - 12.5px); /* 2열: 각각 50% 너비, gap 고려 */
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 40px;
    }
    
    .best-items,
    .new-items {
        padding: 60px 20px;
    }
    
    /* Footer: 2열 */
    .footer-content {
        gap: 30px;
    }
    
    .footer-about {
        flex: 1 1 100%; /* 첫 번째 행 전체 차지 */
    }
    
    .footer-links,
    .footer-info,
    .footer-contact {
        flex: 1 1 calc(50% - 15px); /* 2열 */
    }
}

/* 모바일 (768px 이하) - 1열 */
@media screen and (max-width: 768px) {
    .items-flex {
        flex-direction: column;
        gap: 30px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .items-flex .item {
        flex: 1 1 100%; /* 1열: 전체 너비 */
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .best-items,
    .new-items {
        padding: 50px 20px;
    }
    
    .item-name {
        font-size: 16px;
    }
    
    .item-price {
        font-size: 15px;
    }
    
    /* Footer: 1열 */
    .footer {
        padding: 40px 20px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-about,
    .footer-links,
    .footer-info,
    .footer-contact {
        flex: 1 1 100%; /* 1열: 전체 너비 */
    }
    
    .footer-section h3 {
        font-size: 20px;
    }
    
    .footer-section h4 {
        font-size: 15px;
    }
}

/* 작은 모바일 (480px 이하) */
@media screen and (max-width: 480px) {
    .section-title {
        font-size: 20px;
        letter-spacing: 1px;
        margin-bottom: 25px;
    }
    
    .best-items,
    .new-items {
        padding: 40px 15px;
    }
    
    .item {
        border-radius: 6px;
    }
    
    .item-info {
        padding: 15px;
    }
    
    .btn-view {
        padding: 10px 25px;
        font-size: 13px;
    }
    
    .footer {
        padding: 30px 15px 15px;
    }
    
    .footer-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .footer-section h4 {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .footer-about p,
    .footer-contact p {
        font-size: 13px;
    }
    
    .footer-links a,
    .footer-info a {
        font-size: 13px;
    }
    
    .footer-bottom p {
        font-size: 12px;
    }
}
